How to set proguard for Kotlin-reflect?

1.6k views Asked by At

I'm currently making a module using Kotlin-reflect. When I try to build a binary as a release mode, there is no proguard error, but module is not working.

instance::class.memberProperties.forEach {

    val name = it.annotations.find { annotation -> annotation is Property}
        ?.let { property -> (property as Property).name }
        ?:it.name

    attributeMap[name].let { value ->

        if (value != null && (it is KMutableProperty<*>)) {
            // Log message is not printed after this line.
            it.setter.call(instance, value)
        } else if (value == null) {
            propertyNameMap[it.name] = name
        }
    }
}

I'd set proguard-rules.pro file like this. (https://github.com/square/moshi/issues/402)

-keep interface kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader
-keep class kotlin.reflect.jvm.internal.impl.serialization.deserialization.builtins.BuiltInsLoaderImpl
0

There are 0 answers