OvenChow
OvenChow

Reputation: 11

kotlin.reflect.jvm.internal.KotlinReflectionInternalError when minifyEnabled

I get a problem. when my app minifyenabled is true , it crashed ! and the error is following:

kotlin.reflect.jvm.internal.KotlinReflectionInternalError: This callable does not support a default call: public constructor LoginResultBean

I think there must be some relationships with moshi and R8. I need help...

Upvotes: 1

Views: 1862

Answers (2)

MyNT
MyNT

Reputation: 188

Hope this can help.

  • Solution 1: Use the @Keep annotation for your class. Use this when you have many classes like the one having error and they are defined in different packages, which make it difficult to define the rules in proguard file.
  • Solution 2: you can define rules in the proguard file if they are in the same package (so that you don't have to define many rules). For example -keep class yourpackage.** { *; }. More about the keep option.

Upvotes: 1

sgjesse
sgjesse

Reputation: 4628

As this seems to be caused by reflective code, you might need more keep rules for your program. See https://developer.android.com/studio/build/shrink-code for more information.

Upvotes: 0

Related Questions