A proguard mapping is not uploaded when using a custom artifact dir.
play {
serviceAccountCredentials = file("api.json")
track = "internal"
releaseStatus = "completed"
resolutionStrategy = "auto"
artifactDir = file("$projectDir/build/outputs/apk/release")
}
In proguard-rules.pro I have a line, so that mapping.txt is existent in two places:
app/build/outputs/apk/release/mapping.txtapp/build/outputs/mapping/release/mapping.txt-printmapping build/outputs/apk/release/mapping.txt
publishApk, publishReleaseApk
The mapping is uploaded to GPlay.
This is normal: the mapping file needs to be in the same folder as the artifact dir. If you're just using the APK that's built straight from AGP, then let GPP handle everything for you.
But as I originally stated, the mapping and the APK file are generated in the same folder (build/outputs/apk/release/).
While publishing a release, I execute two separate commands:
./gradlew -Pci --console=plain clean lint assembleRelease --stacktrace./gradlew publishApk --stacktraceAfter the first command, I manually go to the release folder and find that both app-release.apk and mapping.txt files are in place, precisely in $projectDir/app/build/outputs/apk/release.
Then, I execute the second command, and it does upload only APK file. This is clearly not how it is documented in README.md and is a bug. Why would you close it?
Hmmm
I am using it in order not to rebuild the APK. publishApk without an artifact dir definitely works, however I would like to not rebuild an APK.
Yes, I've just checked the mapping file, and it's not empty.
Sure, the info I get is from Google Play Store. The three greened check marks were done without a custom artifact dir.

./gradlew -Pci --console=plain clean lint assembleRelease publishApk --stacktracepublishApk will build the APK again, right after the assembleRelease? If yes, I am not willing to build again, it alters the SHA of the APK file.I can share the logs, sure. Could you provide the exact command with which you would like the logs to be shared? For example, --debug or others?
Nope, that would be horrible UX. If you run any publishing task within the same build as an assemble task, assembly will only run once. This is how Gradle works BTW and isn't related to GPP: a task can only run once per build invocation.
I'm begging you at this point, just remove artifactDir. It'll work as you expect, trust me. 馃槢 However, I would like to get to the bottom of the bug, so can you run ./gradlew publishApk --info > logs.txt and upload the file?
Sidenote: clearly the docs need fixing. Does this make more sense?
Yes, sure. For some reason, this morning my account has been suspended, so I cannot really get you the gradle build info currently, so if you are not in a rush, let's wait and I'll get you the logs.
As per the documentation, I would write like this:
By default, GPP will not build your artifact unless it absolutely has to (e.g. in case there is no artifact available). In advanced cases, this might not be the desired behavior.
Oof, sorry to hear that about your account being suspended. And thanks for your thoughts on the documentation, it gave me an idea which I think is as simple as possible without the confusion you ran into.
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.
Most helpful comment
While publishing a release, I execute two separate commands:
./gradlew -Pci --console=plain clean lint assembleRelease --stacktrace./gradlew publishApk --stacktraceAfter the first command, I manually go to the release folder and find that both
app-release.apkandmapping.txtfiles are in place, precisely in$projectDir/app/build/outputs/apk/release.Then, I execute the second command, and it does upload only APK file. This is clearly not how it is documented in README.md and is a bug. Why would you close it?