gradle-play-publisher icon indicating copy to clipboard operation
gradle-play-publisher copied to clipboard

Firebase Crashlytics mapping file isn't uploaded while publishing artifacts

Open sergei-lapin opened this issue 1 year ago • 8 comments

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

  • Gradle Play Publisher: 3.7.0
  • Gradle Wrapper: 7.5.0
  • Android Gradle Plugin: 7.2.1
  • Firebase Crashlytics Gradle Plugin: 2.9.1

Tasks executed

publishAnyVariantBundle

Expected behavior

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

sergei-lapin avatar Sep 04 '22 10:09 sergei-lapin

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.

waliahimanshu avatar Sep 16 '22 09:09 waliahimanshu

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

SUPERCILEX avatar Sep 16 '22 10:09 SUPERCILEX

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.

waliahimanshu avatar Sep 16 '22 14:09 waliahimanshu

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

SUPERCILEX avatar Sep 16 '22 15:09 SUPERCILEX

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

sergei-lapin avatar Sep 17 '22 17:09 sergei-lapin

@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.

sergei-lapin avatar Sep 17 '22 17:09 sergei-lapin

@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 avatar Sep 20 '22 20:09 waliahimanshu

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

waliahimanshu avatar Sep 24 '22 18:09 waliahimanshu