sentry-android-gradle-plugin: Race condition when creating and packaging sentry-debug-meta.properties
Android Gradle Plugin: 4.1.0
Gradle: 6.7
Optimizer:
- R8
Have you created the sentry.properties file?
- Yes -> in project root
SDKs:
- sentry-android -> 3.1.3
I have the following issue:
Android crash reports are not deobfuscated on Sentry.io. App log shows:
I/Sentry: sentry-debug-meta.properties file was not found.
On clean build, the file is correctly created in build/intermediates/merged_assets folder but it’s missing from the final apk.
On rebuild, the file is included in the apk.
Steps to reproduce:
- Run
gradlew clean assembleReleaseand open the final apk
Actual result:
sentry-debug-meta.propertiesdoesn’t get packaged into apk’s assets folder
Expected result:
sentry-debug-meta.propertiesgets packaged into apk’s assets folder
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 7
- Comments: 18 (10 by maintainers)
Commits related to this issue
- Ensure that the sentry debug properties are added to final APK To ensure that the asset file is added it needs to be available before the proguard task runs. So instead of relying on the CLI to gener... — committed to ansman/sentry-android-gradle-plugin by ansman 3 years ago
- Ensure that the sentry debug properties are added to final APK To ensure that the asset file is added it needs to be available before the proguard task runs. So instead of relying on the CLI to gener... — committed to ansman/sentry-android-gradle-plugin by ansman 3 years ago
- Ensure that the sentry debug properties are added to final APK To ensure that the asset file is added it needs to be available before the proguard task runs. So instead of relying on the CLI to gener... — committed to ansman/sentry-android-gradle-plugin by ansman 3 years ago
- Ensure that the sentry debug properties are added to final APK To ensure that the asset file is added it needs to be available before the proguard task runs. So instead of relying on the CLI to gener... — committed to ansman/sentry-android-gradle-plugin by ansman 3 years ago
- Ensure that the sentry debug properties are added to final APK To ensure that the asset file is added it needs to be available before the proguard task runs. So instead of relying on the CLI to gener... — committed to cortinico/sentry-android-gradle-plugin by ansman 3 years ago
this issue should be solved by https://github.com/getsentry/sentry-android-gradle-plugin/releases/tag/2.0.0-alpha.3 please report any issues you may find, thanks for the patience
I ran into the same problem using AGP 7.0.0-alpha.03 and Gradle 6.8-rc1.
Running
assembleReleasetwice is a workaround for now.I can confirm also using AGP 4.1.1 and Gradle 6.7,
clean assembleReleasedoesn’t work sometimes, but runningassembleReleaseagain just works, looking into itI’m having exactly the same issue, if you execute clean task before assembleRelease, the sentry-debug file won’t be packaged into the apk, but if you rebuild without a clean task, the sentry-debug file will be packaged into the apk.
AGP version: 4.1.0 gradle version:6.5 sentry-android-gradle-plugin version:1.7.36 sentry-android sdk version:3.1.1
As it turns out the CLI already supports passing the UUID. I’ve fixed this issue in #41 using the method and I’ve verified it in our project.
I’ve opened a regression issue on Gradle’s repo, sorry about that, looks like a regression on Gradle or AGP rather than a bug on the plugin, unless this is related to the new incremental and caching system which we don’t take advantage of it, if it’s the case, we’d prioritize to rewrite this plugin as it’s on our backlog anyway.
@headsvk we’re currently rewriting the Gradle Plugin and this will solve the issue, using also @ansman fixes but not only. Subscribe to #50 😃