-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition when creating and packaging sentry-debug-meta.properties #37
Comments
I'm also seeing this issue, any workaround? |
I'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 |
that's odd, but I can't reproduce it, already tried a few times, could any of you make a sample case? this could be either because of a combination of Gradle and AGP version or even how the app modules are structured within the project, so a sample case would be helpful, thanks. |
@marandaneto I upload a demo project and I can reproduce the problem with this empty project. I'm using Android Studio 4.1 btw. Here's the repo: https://github.com/mrrobot97/SentryGradlePluginIssueDemo |
I can confirm also using AGP 4.1.1 and Gradle 6.7, |
@mrrobot97 great that you could make a repo so quickly! |
For a quick update, I can't reproduce the issue if using Gradle <= 6.6.x and AGP <= 4.0.x, so a workaround, for now, would be to downgrade them, still looking into it, I've tested using our latest version btw (1.7.36) |
Yeah I'm using AGP 4.0.2 and it's working correctly. |
yeah but it's not only about AGP I'd say, Gradle 6.7 and AGP 4.0.x still causes the issue, I need to read their changelogs now and see if I can find out. |
I debugged a bit more and found out the following case on the 2nd run (without the
we need to execute our task after the thing is, looks like Gradle keeps a caching of the files in memory and it's not somehow notified that a new file has been created, in the 2nd run, it identifies a new file (see debug message above) and pack it, I'm still not sure how to solve that, looks like the code is correct but Gradle is not up to date if we write a file on the folder at the last minute, also important to note that we write this file using a 3rd party and not a Gradle task (Copy type). I'll need to learn a bit more about the internals of Gradle and AGP. |
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. |
I ran into the same problem using AGP 7.0.0-alpha.03 and Gradle 6.8-rc1. Running |
Hi all, I previously hit a very similar issue on a previous version of the plugin, and at the time as a temporary workaround I received the suggestion to force the metadata file generation as described here: getsentry/sentry-java#740 (comment) Unfortunately no such luck this time, as mentioned above the ordering itself appears to be fine. In our case running the build twice is quite onerous as a workaround, so we will probably roll back for now, if anyone find a way to trick gradle into picking up the |
Did you consider allowing passing the mapping file ID when uploading them instead of relying on the backend to generate one? This would allow you to work around this issue since you can generate the build ID much earlier in the process. Of course that's a bigger change since you need to build support in the backend, CLI as well as adding validation. |
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 generate the UUID there is now a separate task that creates it and --uuid is used in the CLI to match the mappings to the build. This fixed getsentry#37
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 generate the UUID there is now a separate task that creates it and --uuid is used in the CLI to match the mappings to the build. This fixes getsentry#37
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 generate the UUID there is now a separate task that creates it and --uuid is used in the CLI to match the mappings to the build. This fixes getsentry#37
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 generate the UUID there is now a separate task that creates it and --uuid is used in the CLI to match the mappings to the build. This fixes getsentry#37
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. |
@marandaneto what's the status on merging @ansman's fix? Not having to run assemble task twice would speed up our build pipeline 🙏 |
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 generate the UUID there is now a separate task that creates it and --uuid is used in the CLI to match the mappings to the build. This fixes getsentry#37
this issue should be solved by https://github.com/getsentry/sentry-android-gradle-plugin/releases/tag/2.0.0-alpha.3 |
Android Gradle Plugin:
4.1.0
Gradle:
6.7
Optimizer:
Have you created the sentry.properties file?
SDKs:
I have the following issue:
Android crash reports are not deobfuscated on Sentry.io.
App log shows:
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:
gradlew clean assembleRelease
and open the final apkActual result:
sentry-debug-meta.properties
doesn't get packaged into apk's assets folderExpected result:
sentry-debug-meta.properties
gets packaged into apk's assets folderThe text was updated successfully, but these errors were encountered: