In my use case we only provide signing and uploading credentials on the CI server. That means that the configuration recieves a non existing file for the serviceAccountCredentials configuration for every other build. Since the sanity check is performed on project configuration the plugin cancels every gradle task even if no publishing is intended (e.g. assemble). This was not the case with the previous version.
The culprit is here: https://github.com/Triple-T/gradle-play-publisher/blob/2fd7ef40e29ebcd0c7dd44ce4fd0c9aed6d77e12/plugin/src/main/kotlin/com/github/triplet/gradle/play/PlayPublisherPlugin.kt#L99
The plugin automatically assumes that the credentials provided are PKCS12 if they are not recognized to be JSON.
Try building a project with following configuration for the play publisher plugin:
play {
serviceAccountCredentials = file(getRootDir().path)
track 'internal'
}
The error message is misleading since the problem here is that no credentials are provided at all.
Correct configuration of the plugin is only relevant if an actual publish task is being executed. At this early stage it blocks any task execution and not just the publishing. This would be consistent with other plugins e.g. the android plugin is concerned with missing signing credentials only when an actual signing task is performed.
Another option is to convert these checks into warnings.
Is there already a way to disable theses checks that I am not aware of?
As you noticed in the source code, as long as the file name ends in json, we'll assume the credentials are correct whether or not they actually exist. For now, you can use this hack.
As for changing this, we plan to allow not specifying credentials in v2.1. See #461 for more details.
Most helpful comment
As you noticed in the source code, as long as the file name ends in
json, we'll assume the credentials are correct whether or not they actually exist. For now, you can use this hack.As for changing this, we plan to allow not specifying credentials in v2.1. See #461 for more details.