Hi all,
Due to having a very large project, I need to use proguard to shrink things down.
Does anybody have an example of a working proguard config for an android app? I would be very grateful.
Specifically, I am getting this error:
E/AndroidRuntime(3268): java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder
I have tried fixing it with this line in my proguard:
-keep class org.slf4j.** { *; }
But I still get the same error. I am thinking the class is called indirectly through an implementation or something.
Any help with proguard examples would be fantastic, thanks.
Proguard examples?
Re: Proguard examples?
The problem with shrinking support libraries is that you don't know what they do at runtime and failure may pop up at any time.
I wouldn't recommend it.
Anything that uses reflection or dynamic class loading (as slf4j) may fail at some point but you'll never know unless you thoroughly test your application. It's a little bit of a crapshoot, imho
I wouldn't recommend it.
Anything that uses reflection or dynamic class loading (as slf4j) may fail at some point but you'll never know unless you thoroughly test your application. It's a little bit of a crapshoot, imho
Re: Proguard examples?
Thanks Lapo. I wish there were a way to tell proguard to keep everything in the SFS support library. If I can't find a way to force it, I guess I will have to turn parts of my code into plugins with multiple dex files.
Re: Proguard examples?
Turns out my problems were from gradle not packing a jar.
To be safe in proguard, I ended up just listing classes to exclude (big ones that were part of certain jars but I didn't use). That way I know all SFS code makes it in. Did something like this:
-keep class !com.google.android.gms.wallet.**,!com.google.android.gms.maps.** { *; }
To be safe in proguard, I ended up just listing classes to exclude (big ones that were part of certain jars but I didn't use). That way I know all SFS code makes it in. Did something like this:
-keep class !com.google.android.gms.wallet.**,!com.google.android.gms.maps.** { *; }
Re: Proguard examples?
I have this problem to
When i build my project in android i get some errors about sfs.
How can i exclude sfs libraries from proguard?
Thanks
When i build my project in android i get some errors about sfs.
How can i exclude sfs libraries from proguard?
Thanks
Re: Proguard examples?
Hi,
I did many searches to solve the problem, but finally i solved the that myself:
-keep class org.python.*{ *; }
-dontwarn org.python.**
-keep class com.smartfoxserver.*{ *; }
-dontwarn com.smartfoxserver.**
-keep class org.jaxen.*{ *; }
-dontwarn org.jaxen.**
-keep class java.rmi.*{ *; }
-dontwarn java.rmi.**
-keep class org.jboss.*{ *; }
-dontwarn org.jboss.**
just use above lines in your proguard
Thanks.
I did many searches to solve the problem, but finally i solved the that myself:
-keep class org.python.*{ *; }
-dontwarn org.python.**
-keep class com.smartfoxserver.*{ *; }
-dontwarn com.smartfoxserver.**
-keep class org.jaxen.*{ *; }
-dontwarn org.jaxen.**
-keep class java.rmi.*{ *; }
-dontwarn java.rmi.**
-keep class org.jboss.*{ *; }
-dontwarn org.jboss.**
just use above lines in your proguard
Thanks.
Return to “SFS2X Java / Android API”
Who is online
Users browsing this forum: No registered users and 14 guests