-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Auto-Installation version mismatch causes runtime crash #329
Comments
@PaulWoitaschek are you using Can you add to your app's proguard file:
And check if the rule to keep Thanks. |
It does not exist. But wait; we're not using sentry-android-ndk. It seems the plugin adds that, where we add the 6.0.0 core dependency. Maybe this is related to the plugin adding an outdated dependency? sentry-android-gradle-plugin/plugin-build/src/main/kotlin/io/sentry/android/gradle/SentryPlugin.kt Line 327 in 1deb7a6
|
Yes, confirmed. Setting the version in the autoInstallation block fixes it. I think this is a dependency issue: In the final dependeny graph this leads to inconsistent dependencies:
Disabling the auto installation also works. From your side this coulde be mitigated by publishing a bom. |
We do publish a bom already -> https://docs.sentry.io/platforms/android/configuration/bill-of-materials/. I'm not sure the bom would help here though, because if we apply the bom with the version Ideally we'd look at your dependency tree and use the version that you've specified in the module, but that's unfortunately not possible without resolving the configuration, and this can be quite heavy for the build time (we have an improvement to at least warn you about that though (#324). There are also other multiple improvements to this:
|
From my understanding, an applied Besides that, moving the plugin and the java library to the same repository and releasing them with the same version would mitigate these errors (where plugin and lib are out of sync) as well. |
Ah, I wasn't aware of We actually wanted to be conservative here, and do not override any of the user-defined dependencies, but maybe it'd be better to have them enforced (e.g. by using a bom and giving user an option to specify a version) @bruno-garcia @marandaneto wdyt? |
Problem of us overriding the version is that user can't override our behavior it turns out to be wrong. Could we log a build warning instead? |
In general, the approach to let users overwrite versions is good. But in the case that you use auto-install, it is error prone and leads to inconsistent versions (which has caused the crash I'm reporting). And you can explicitly set the version in the auto install extension already so I expect this to solve more issues than it causes. |
It's kind of possible through
Having an option for that is also possible, yep. |
Yep, we should not override the user-defined dependencies to not force the need of upgrading the Sentry SDK nor the need of removing the Sentry Gradle plugin due to not being compatible. |
All Sentry packages should be the very same version, we should not allow the mix of e.g. sentry-android-core 5.7 and sentry-android-timber 6.0, packages are published together with the very same version to avoid incompatibilities. |
If the user defined 5.7.0 in its dependencies block (it doesn't matter if its the core package or not, versions should be aligned), we should keep using 5.7.0, if this is technically not possible or too expensive, I'd say we should turn off the auto-install for this use case. |
Moved this to the SAGP repo, as it rather belongs here. |
SentryAndroid#init
crashes
@PaulWoitaschek we've released |
We could have a gradle task which looks over the dependency tree and see if there are mismatched sentry packages' versions, fail the build or show a warning. |
Integration
sentry-android
Build System
Gradle
AGP Version
7.2.1
Proguard
Enabled
Version
6.0.0, plugin=3.1.0
Steps to Reproduce
Build an obfuscated release build and call:
Expected Result
It doesn't crash
Actual Result
Follow up of the discussion in getsentry/sentry-java#2031
Calling
options.isEnableNdk = false
causes the crash to not appear.Stacktrace
The text was updated successfully, but these errors were encountered: