Are there examples of how to strip away a top leve...
# android
m
Are there examples of how to strip away a top level Kotlin extension function (with default parameter) with proguard? Right now I have the following:
Copy code
-assumenosideeffects class com.example.package.ExtensionsKt {
    public static void myFunction(...);
}
The function is defined as follows:
Copy code
fun Any.myFunction(param1: String, param2: Throwable? = null) {
    ...
}
But it does not work sadly, I also tried the following (method signature copied from mapping.txt) which also does not work:
Copy code
-assumenosideeffects class com.example.package.ExtensionsKt {
     public static void myFunction(java.lang.Object,java.lang.String,java.lang.Throwable);
     public static void myFunction$default(java.lang.Object,java.lang.String,java.lang.Throwable,int,java.lang.Object);
}
t
Did you manage to strip any other method using Proguard ? If you don't, maybe you haven't enabled Proguard optimizations. This answer may help : https://stackoverflow.com/a/25280494/8691695
m
You are right, I missed putting the proguard-android-optimize.txt inside the getDefaultProguardFile() part, thank you 👍