Closed mkubele closed 3 years ago
Does this issue still occur with GPP 3.4.0? Can you also share the result of running ./gradlew help --debug | grep PlayExtensionConfig
?
Yes, the same occurs with the v3.4.0. This is the output of the help command:
2021-04-27T01:14:24.137+0200 [DEBUG] [org.gradle.api.Project] Extension computed for variant 'defaultFirstDebug': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.21.13828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-04-27T01:14:24.401+0200 [DEBUG] [org.gradle.api.Project] Extension computed for variant 'specialFirstDebug': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.21.13828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-04-27T01:14:24.540+0200 [DEBUG] [org.gradle.api.Project] Extension computed for variant 'defaultFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.21.13828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-04-27T01:14:24.706+0200 [DEBUG] [org.gradle.api.Project] Extension computed for variant 'specialFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/SPECIAL_FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=2.21.5828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-04-27T01:14:28.224+0200 [DEBUG] [org.gradle.api.Project] Extension resolved for variant 'defaultFirstDebug': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.21.13828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-04-27T01:14:28.224+0200 [DEBUG] [org.gradle.api.Project] Extension resolved for variant 'specialFirstDebug': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.21.13828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-04-27T01:14:28.225+0200 [DEBUG] [org.gradle.api.Project] Extension resolved for variant 'defaultFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.21.13828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-04-27T01:14:28.225+0200 [DEBUG] [org.gradle.api.Project] Extension resolved for variant 'specialFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/SPECIAL_FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=2.21.5828, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
Hmmm, how do you know the wrong key is being used? The 4th line shows that SPECIAL_FIRST_KEY.json
is used for specialFirstRelease
.
this is my guess by experiment. With this setting, I'm getting this error from the google api:
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/APPLICATION/edits
{
"code": 403,
"errors": [
{
"domain": "global",
"message": "The caller does not have permission",
"reason": "forbidden"
}
],
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
So after checking other settings I came to the conclusion it's caused by the used key. I tried to set the same key for both configurations and then it worked
playConfigs {
register("specialFirstRelease") {
serviceAccountCredentials.set(SPECIAL_FIRST_KEY)
enabled.set(true)
}
register("first") {
serviceAccountCredentials.set(SPECIAL_FIRST_KEY)
enabled.set(true)
}
}
I'd lean more towards the key not actually having permissions. You can try this by specifying only FIRST_KEY
... if it still doesn't have permissions then it's an issue with that key.
Oh, I forgot to mention - it works fine with v2.8.0, that I used before and I upgraded from.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Finally managed to repro!
Once the build finishes can you check that the bug is fixed on your end? https://github.com/Triple-T/gradle-play-publisher#snapshot-builds
I tried the 3.5.0-SNAPSHOT and it still does not work. I tried to run ./gradlew help --debug | grep PlayExtensionConfig
and in the result I can see there is the wrong key set
2021-05-10T11:44:50.334+0200 [DEBUG] [org.gradle.api.Project] Extension computed for variant 'defaultFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.22.13806, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-05-10T11:44:50.386+0200 [DEBUG] [org.gradle.api.Project] Extension computed for variant 'specialFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.22.13806, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-05-10T11:44:53.510+0200 [DEBUG] [org.gradle.api.Project] Extension resolved for variant 'defaultFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.22.13806, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
2021-05-10T11:44:53.510+0200 [DEBUG] [org.gradle.api.Project] Extension resolved for variant 'specialFirstRelease': PlayExtensionConfig(enabled=true, serviceAccountCredentials=/Users/USER/.keys/FIRST_KEY.json, defaultToAppBundles=false, commit=true, fromTrack=null, track=internal, promoteTrack=null, userFraction=null, updatePriority=null, releaseStatus=DRAFT, releaseName=6.22.13806, resolutionStrategy=FAIL, retainArtifacts=[], retainMainObb=null, retainPatchObb=null)
Did you change your playConfigs
? The output of that command shouldn't have changed.
No, the only thing I changed is the version. It seems something was messed up with Gradle. I still have the file from two weeks ago with the output and the key is set correctly there. But I double checked it now again, and the only version where the settings in the debug command output is correct is v2.8.0. All versions from v3.2.0 up are all set wrong now.
Hmmm, can you maybe share more of your Gradle file? Something else must be messed up. Here's how I set up the test BTW: https://github.com/Triple-T/gradle-play-publisher/blob/ece2df894a31ff4425de446ecb4ebdbebb4c6361/play/plugin/src/test/kotlin/com/github/triplet/gradle/play/PlayPublisherPluginIntegrationTest.kt#L394-L416
I realised that gradle file was actually changed - I switched from extension to the config you have in the test app. So, the correct file is set with v3.5.0-SNAPSHOT with this config:
this as ExtensionAware).extensions.configure<NamedDomainObjectContainer<PlayPublisherExtension>>("playConfigs") {
register("specialFirstRelease") {
serviceAccountCredentials.set(file(System.getProperty("user.home") + "/.keys/SPECIAL_FIRST_KEY"))
}
register("first") {
serviceAccountCredentials.set(file(System.getProperty("user.home") + "/.keys/FIRST_KEY"))
}
}
The output of debug command is correct upload works flawlessly. Issue is when I use this way of config:
play {
track.set(getPlayPublishTrack())
releaseStatus.set(if (track.equals("internal")) ReleaseStatus.COMPLETED else ReleaseStatus.DRAFT)
enabled.set(false)
}
playConfigs {
register("specialFirstRelease") {
serviceAccountCredentials.set(file(System.getProperty("user.home") + "/.keys/SPECIAL_FIRST_KEY"))
enabled.set(true)
}
register("first") {
serviceAccountCredentials.set(file(System.getProperty("user.home") + "/.keys/FIRST_KEY"))
enabled.set(true)
}
}
(this as ExtensionAware).extensions.configure<NamedDomainObjectContainer<PlayPublisherExtension>>("playConfigs")
and just playConfigs
should be identical. (We have to use that ugly hack in the testapp because we can't use the plugins block.)
Maybe enabled
is messing stuff up? Glad to hear the original bug is fixed though.
Yes, it is fixed, thank you very much! Do you have any estimate of release date of the v3.5.0? Also, should I create a new issue regarding the config?
No ETA on a new release, though I'd like to get one out soon (maybe this weekend or the next).
And sure, you can file an issue about the config. I'll probably need more details though because I can't repro.
Describe the bug
Hey, I have a project with multiple flavours and wrong authentication file is used when I specify authentication file for the exact flavour combination. Example of my configuration:
So when I run publishSpecialFirstReleaseBundle, _FIRSTKEY is used instead of the expected _SPECIAL_FIRSTKEY
How To Reproduce
Try to publish in a multi flavour project (as example above)
Versions
Tasks executed
publishSpecialFirstReleaseBundle
Expected behavior
Defined authentication file is used.