-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Insufficient Proguard configuration rules #1564
Comments
According to the documentation
Not sure we can replace |
The |
@christofferqa I don't see where it is documented |
According to the documentation, |
If a field is never written, R8 will replace all reads of that field by the default value of the field. Therefore it is important that the Proguard configuration for kotlinx.coroutines correctly specifies which fields are written using reflection.
In https://issuetracker.google.com/issues/141416122, a small project is shared that breaks due to missing Proguard configuration rules in kotlinx.coroutines. I found that adding the following two keep rules to the project solves the issue.
I then found that the Proguard configuration rules for kotlinx.coroutines contain the following rule (https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/resources/META-INF/proguard/coroutines.pro#L8):
This should be updated to:
In addition to specifying that the names of these fields cannot be changed, this also specifies that these fields are assigned using reflection (in this case, AtomicReferenceFieldUpdater).
Originally filed at https://issuetracker.google.com/issues/141416122 and ktorio/ktor#1354.
The text was updated successfully, but these errors were encountered: