Closed sergiuciuperca closed 10 months ago
Hi @sergiuciuperca thanks for reaching out and providing some details around this issue!
It looks like this is caused due to app-start instrumentation, which was added in 4.1.0
As a workaround you can disable this specific instrumentation by applying the following config to your app/build.gradle
file
sentry {
tracingInstrumentation {
appStart {
enabled = true
}
}
}
After some investigation we came to the conclusion that this is due to R8/ProGuard obfuscation being applied onto pre-bundled libraries. The obfuscation makes any bytecode instrumentation on top brittle as it optimizes away common assumptions and rules, e.g. this is no longer true.
On instance method invocation, local variable 0 is always used to pass a reference to the object on which the instance method is being invoked (this in the Java programming language). https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.6.1
We're still investigating if there are ways around this, otherwise we'd resort to excluding specific package names from being instrumented.
Hey @sergiuciuperca thanks again for reporting this issue. Good news: A fix shipped with version 4.1.1
of our sentry-android-gradle-plugin.
Thank you!
Integration
sentry-android
Build System
Gradle
AGP Version
8.2.0
Proguard
Disabled
Version
7.1.0
Steps to Reproduce
We are using GooglePlay Services MLKit for face detection. App started to crash after upgrade to sentry v7.1.0 from v6.34.0, and sentry-gradle-plugin from 3.14.0 to 4.1.0.
Maybe something related: https://github.com/getsentry/sentry-android-gradle-plugin/issues/315
Expected Result
No crash
Actual Result