Skip to content

Missing Proguard rules? Crash at 'java.lang.NoSuchFieldException: No field result in class Lkotlin/f/i;' #1694

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

Closed
fightyz opened this issue Dec 9, 2019 · 0 comments

Comments

@fightyz
Copy link

fightyz commented Dec 9, 2019

I'm using Kotlin coroutine 1.3.2, and my app is obfuscated. When I using coroutines, I get the following crash stack:

java.lang.RuntimeException: java.lang.NoSuchFieldException: No field result in class Lkotlin/f/i;
java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.<init>(AtomicReferenceFieldUpdater.java:338)
	at java.util.concurrent.atomic.AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdater.java:109)
	at kotlin.coroutines.SafeContinuation.<clinit>(SourceFile:31)

According to the mapping file, the class Lkotlin/f/i is actually SafeContinuation. I look into SafeContinuation, there is a field named result, and it is volatile.

I also noticed that the Kotlin extension library's proguard file has kept all volatile field. So I guess it is also necessary to keep all volatile in Kotlin's stdlib?

@fightyz fightyz changed the title Missing Proguard rules? Crash on 'java.lang.NoSuchFieldException: No field result in class Lkotlin/f/i;' Missing Proguard rules? Crash at 'java.lang.NoSuchFieldException: No field result in class Lkotlin/f/i;' Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant