I declared a package-level function as utility in my library and I want to use it in my main app.
My issue is that I am not able to keep it from code obfuscation using proguard (and consequently use it in my main app).
My file it.blabla.util.Extensions.kt
fun foo(context: Context, action: String) {
...
}
I already tried to keep it in proguard using:
-keep class it.blablabla.util.UtilPackage.** { *; }
or
-keep class it.blablabla.util.** { *; }
but none of these is working.
In my app I'm trying to use foo as follows:
foo(applicationContext, "test")
but I'm not able to find the right import to let foo become visible in my app through the aar module. I keep getting the following compilation error:
Unresolved reference: foo
You most likely have to keep the the class as well as keeping the metadata (proguard doc):
-keep class it.blablabla.util.ExtensionsKt {
*;
}
-keepkotlinmetadata
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With