Skip to content
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

Issues with Android R8 #382

Open
ToxicBakery opened this issue Jul 17, 2023 · 0 comments
Open

Issues with Android R8 #382

ToxicBakery opened this issue Jul 17, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@ToxicBakery
Copy link

ToxicBakery commented Jul 17, 2023

Android R8 seems to cause pain on release builds. In our use case we had a lot of type parameter errors that look like this

java.lang.IllegalArgumentException: Class declares 0 type parameters, but 1 were provided.
                 	at kotlin.reflect.full.KClassifiers.createType(SourceFile:53)
                 	at kotlin.reflect.jvm.internal.CachesKt.getOrCreateKTypeWithTypeArguments(SourceFile:69)
                 	at kotlin.reflect.jvm.internal.CachesKt.getOrCreateKType(SourceFile:58)
                 	at kotlin.reflect.jvm.internal.ReflectionFactoryImpl.typeOf(SourceFile:123)
                 	at kotlin.jvm.internal.Reflection.typeOf(SourceFile:133)

In proguard-rules.pro this configuration resolves the issue but it could likely be improved to target the specific classes relevant to the problem.

-keep class de.jensklingenberg.ktorfit.** { *; }
-keepclassmembers class de.jensklingenberg.ktorfit.** { *; }

I did not see documentation for this issue and the other proguard related issue seems to be about reflect itself and not the issue we had.

@ToxicBakery ToxicBakery added the documentation Improvements or additions to documentation label Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant