Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.1k stars 339 forks source link

Firebase Crashlytics mapping file isn't uploaded while publishing artifacts #1062

Open sergei-lapin opened 1 year ago

sergei-lapin commented 1 year ago

Describe the bug

uploadCrashlyticsMappingFile$variantName is not there at the time of configuring of publish* tasks and is not wired as dependency for these tasks resulting in lack of mapping file in crashlytics for the published release

How To Reproduce

Apply com.google.firebase.crashlytics plugin to any Gradle module with com.android.application and com.github.triplet.play, run publishBundle

Versions

Tasks executed

publishAnyVariantBundle

Expected behavior

uploadCrashlyticsMappingFile$variantName is executed whenever publish task for specified variantName is executed

waliahimanshu commented 1 year ago

We are facing the same issue, it started happening without any changes from our end a couple of releases ago, as a result crashes/non-fatals are not readable anymore!

https://gist.github.com/waliahimanshu/82531ec881df1363e2ea5cd77ed6aeee

We also run bundleRelease before publish, which also executes uploadCrashlyticsMappingFile but for some reason not working as expected, and our crashes/non-fatal still end up as obfuscated.

@sergei-lapin did this issue make your crashes appear as obfuscated in FirebaseCrashlyics ? I tried to upload the mapping manually, which showed success but crashlytics still shows everything as obfuscated.

SUPERCILEX commented 1 year ago

The task name probably changed? This is what it's set to right now: https://github.com/Triple-T/gradle-play-publisher/blob/4273731c8126cdbf071300882718ec2ae12f3e3c/play/plugin/src/main/kotlin/com/github/triplet/gradle/play/PlayPublisherPlugin.kt#L646

waliahimanshu commented 1 year ago

when I run bundle$variantName I can see that uploadCrashlyticsMappingFile$variantName executes so, possibly, the name is not changed.

> Task :app:uploadCrashlyticsMappingFileRelease
Caching disabled for task ':app:uploadCrashlyticsMappingFileRelease' because:
  Caching has not been enabled for the task
Task ':app:uploadCrashlyticsMappingFileRelease' is not up-to-date because:
  Task has not declared any outputs despite executing actions.
Mapping file uploaded: /Users/himanshuwalia/StudioProjects/global-android/app/build/outputs/mapping/Release/mapping.txt
:app:uploadCrashlyticsMappingFileRelease (Thread[Execution worker for ':' Thread 9,5,main]) completed. Took 6.507 secs.
SUPERCILEX commented 1 year ago

No clue then unfortunately. Nothing has changed on our end.

sergei-lapin commented 1 year ago

Firebase Plugin might've changed moment when they register their uploadCrashlyticsMappingFile$variantName to smth like afterEvaluate instead of onVariants

sergei-lapin commented 1 year ago

@sergei-lapin did this issue make your crashes appear as obfuscated in FirebaseCrashlyics ? I tried to upload the mapping manually, which showed success but crashlytics still shows everything as obfuscated.

@waliahimanshu yes, it did. It should be obfuscated if you run bundle and publish tasks in different Gradle invocations, though, due to lack of injected identifier that comes with uploadCrashlyticsMappingFile.

waliahimanshu commented 1 year ago

@sergei-lapin did this issue make your crashes appear as obfuscated in FirebaseCrashlyics ? I tried to upload the mapping manually, which showed success but crashlytics still shows everything as obfuscated.

@waliahimanshu yes, it did. It should be obfuscated if you run bundle and publish tasks in different Gradle invocations, though, due to the lack of injected identifier that comes with uploadCrashlyticsMappingFile.

So running bundle and publish in the same grade invocation, will upload the mapping file and make the crashes readable (de-obfuscated)? We previously hit the same issue and ended up following this workaround though as a separate gradle invocations withing the same workflow, which used to work, but no anymore!

waliahimanshu commented 1 year ago

Update running bundleRelease and publishRelease in the single Gradle invocation fixed the issue.