question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.IllegalAccessError with ProGuard enabled

See original GitHub issue

Hey,

I’m executing a simple coroutine:

launch {
  delay(300, MILLISECONDS)
  launch(UI) { view.doStuff() }
}

which works fine without running ProGuard.

However, when it’s enabled, it’s crashing with:

Fatal Exception: java.lang.IllegalAccessError
Final field 'c.c.a.a.c.a' cannot be written to by method 'void c.c.a.a.d.<clinit>()' (declaration of 'c.c.a.a.d' appears in /data/app/de.memorian.gzg-vqA1ApwTLUsJNJy9FqbjTw==/base.apk)
kotlin.coroutines.experimental.intrinsics.IntrinsicsKt__IntrinsicsKt__Clinit.
kotlin.coroutines.experimental.intrinsics.IntrinsicsKt__IntrinsicsKt__Clinit. (Unknown Source:1060)
kotlin.coroutines.experimental.intrinsics.IntrinsicsKt__IntrinsicsKt__Clinit.$$clinitTrigger (Unknown Source)
de.memorian.gzg.presentation.actions.ActionsPresenter$scrollDelayedToTop$1.invoke (Unknown Source)
kotlin.coroutines.experimental.jvm.internal.CoroutineImpl.resume (CoroutineImpl.kt:42)
kotlinx.coroutines.experimental.DispatchedTask$DefaultImpls.run (Dispatched.kt:162)
kotlinx.coroutines.experimental.DispatchedContinuation.run (Dispatched.kt:26)

Kotlin version: 1.2.50 Coroutine version: 0.23.3

ProGuard:

-keepclassmembernames class kotlinx.** {
    volatile <fields>;
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
max-kammerercommented, Jun 19, 2018

Could use check your build with

-keepclassmembers class  *  {
    void $$clinit();
}
0reactions
Syexcommented, Jun 19, 2018

Closing this issue then as it’s not related to coroutines.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tried to access method com.google.android.gms.internal.eo.ak ...
After upload APK to google playstore, from Crashlytics I got crash in file ActivityThread.java line 2423: android.app.ActivityThread.
Read more >
A Journey of an IllegalAccessError issue | by Eric Lu - Medium
The restored crash log (using ProGuard mapping file): java.lang.IllegalAccessError: tried to access class com.eric.manager.
Read more >
Getting an IllegalAcessException when using proguard ...
The deobfuscated trace is: java.lang.IllegalAccessError: Interface c.a.b.c.c.a$a implemented by class com.example.myapplication.b is inaccessible (declaration ...
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
To make your app as small as possible, you should enable shrinking in your ... The Android Gradle plugin generates proguard-android-optimize.txt , which ......
Read more >
Why is ProGuard generating code that requires `--enable-preview ...
On JDK 15 all was working fine with or without ProGuard. ... startInternal(StandardContext.java:5180) at org.apache.catalina.util.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found