braze-android-sdk
braze-android-sdk copied to clipboard
[Bug]: Crash - NoSuchFieldError - No static field Key of type CoroutineExceptionHandler
Braze Android SDK Version
30.0.0
Steps To Reproduce
Couldn't reproduce
Expected Behavior
Not crashing the app
Actual Incorrect Behavior
Crashing the app
Verbose Logs
Fatal Exception: java.lang.NoSuchFieldError: No static field Key of type Lkotlinx/coroutines/CoroutineExceptionHandler$Key; in class Lkotlinx/coroutines/CoroutineExceptionHandler; or its superclasses (declaration of 'kotlinx.coroutines.CoroutineExceptionHandler' appears in base.apk)
at com.braze.coroutine.BrazeCoroutineScope.<clinit>(SourceFile:1)
at com.braze.images.DefaultBrazeImageLoader.initDiskCacheTask(SourceFile:1)
at com.braze.images.DefaultBrazeImageLoader.<init>(SourceFile:9)
at com.braze.Braze.<init>(SourceFile:49)
at com.braze.Braze$Companion.getInstance(SourceFile:4)
at fr.vestiairecollective.BaseApplication.initBraze(BaseApplication.kt:385)
at fr.vestiairecollective.BaseApplication.onCreate(BaseApplication.kt:105)
at fr.vestiairecollective.app.VestiaireApplication.onCreate(VestiaireApplication.kt:27)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:2)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
at android.app.ActivityThread.access$1100(ActivityThread.java:199)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Additional Information
Since we have upgrade the SDK to the latest version 30.0.0 we are noticing some crash only for Rooted, Unknown device - GCE X86 Phone, Android 9
- Please post your gradle app dependency tree
./gradlew app:dependencies
- What version of kotlin coroutines are you using?
Hi @radixdev
Thanks for your quick reply.
- Can you be a bit a more specific about this, we would like to avoid sharing our entire dependency tree.
- We are using Kotlin coroutines version 1.8.0
- We can move this to [email protected] in order to avoid sharing the necessary info in this public setting.
- The crash seems to be coming from inside the coroutines library itself and implies some proguard/r8 mishap. We can also gather that info in a more secure setting
@radixdev
We have also similar crash on 24.2.0
Here is the partial stack trace:
Fatal Exception: java.lang.IncompatibleClassChangeError: Class kotlinx.coroutines.b2 implements non-interface class kotlinx.coroutines.w (declaration of 'kotlinx.coroutines.b2' appears in /data/app/~~nO8zurTIQqcq4xDRyC6PEA==/org.gamatech.androidclient.app-dVcnEj1t6Na24Qhc2SwQXA==/base.apk!classes3.dex)
at kotlinx.coroutines.SupervisorKt.SupervisorJob(Supervisor.kt:33)
at kotlinx.coroutines.SupervisorKt.SupervisorJob$default(Supervisor.kt:33)
at com.braze.coroutine.BrazeCoroutineScope.<clinit>(SourceFile:6)
at com.braze.images.DefaultBrazeImageLoader.initDiskCacheTask(SourceFile:1)
at com.braze.images.DefaultBrazeImageLoader.<init>(SourceFile:9)
at com.braze.Braze.<init>(SourceFile:46)
We can share a full stack trace if needed.
Similar crash for version "com.appboy:android-sdk-ui:24.3.0"
Here is the partial stack trace:
Caused by java.lang.NoSuchFieldError: No field Key of type Lkotlinx/coroutines/CoroutineExceptionHandler$Key; in class Lkotlinx/coroutines/CoroutineExceptionHandler; or its superclasses (declaration of 'kotlinx.coroutines.CoroutineExceptionHandler' appears in /data/app/~~eeq_LnkvDmbh5kjBzdRwNQ==/androidx.test.tools.crawler-88OUb8Xa60vtI8BSBXoWiA==/base.apk)
at com.braze.coroutine.BrazeCoroutineScope.
Hi @radixdev I just sent an email to your support email address with the full dependency tree. Hope this will help. Thanks
Hi @RitaBags, your issue might be different and more relevant to this thread: https://stackoverflow.com/questions/78041019/google-play-testing-app-crash-java-lang-nosuchfielderror-no-field-key-of-type/78064831#comment137776357_78064831. Please let us know if you still experience it or have more questions. Thanks.
Closing this issue for now. Please let us know if this can be reproduced as an SDK issue and not a bug with the coroutines library itself.