Is it safe to ignore these proguard notes for kotl

2019-05-20 02:45发布

问题:

I don't understand why I'm getting these notes from proguard and if I've to do anything to address them.

Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class 
kotlin.internal.jdk8.JDK8PlatformImplementations 
Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class 
kotlin.internal.JRE8PlatformImplementations 
Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically referenced class 
kotlin.internal.JRE7PlatformImplementations 

Note: kotlin.jvm.internal.Reflection: can't find dynamically referenced class 
kotlin.reflect.jvm.internal.ReflectionFactoryImpl

Three of them are for kotlin.internal.PlatformImplementationKt and one for kotlin.jvm.internal.Reflection

My setup

kotlin: 1.2.71
Android Studio / gradle plugin: 3.2.0
gradle: 4.10.2

回答1:

Yes it is safe, you should add those rules to your proguard-rules.pro configuration

# Kotlin
-keep class kotlin.Metadata { *; }
-dontnote kotlin.internal.PlatformImplementationsKt
-dontnote kotlin.reflect.jvm.internal.**