I'm using ProGuard for my spring boot application code. After I upgraded to Spring Boot 2, I cannot start my application anymore.
Spring Boot 2 uses kotlin-reflect to create beans, which uses kotlin.Metadata
annotation during reflection. This annotation has unobfuscated values and therefore kotlin-reflect is looking for methods with original names. and following exception is thrown:
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Could not compute caller for function: public constructor ProjectService(...
ProjectService
is obfuscated to F
, hence no such constructor.
When I keep class names, I have same problem elsewhere:
kotlin.reflect.jvm.internal.KotlinReflectionInternalError: Could not compute caller for function: public open fun addRole(...
Is there a way to fix the obfuscation of kotlin.Metadata
annotation parameters? Annotation itself is not obfuscated and it still refers to original class names which are written as string values. I also tried to obfuscate the Metadata annotation to no avail.