My application has references to HoloEverywhere and SherlockActionBar, both which are in-workspace projects. When I enabled Proguard for the application only, it crashes giving these errors:
11-15 11:50:11.090: E/AndroidRuntime(24823): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
11-15 11:50:11.090: E/AndroidRuntime(24823): at com.actionbarsherlock.a.a(Unknown Source)
11-15 11:50:11.090: E/AndroidRuntime(24823): at org.holoeverywhere.a.a.l(Unknown Source)
11-15 11:50:11.090: E/AndroidRuntime(24823): at org.holoeverywhere.a.a.setContentView(Unknown Source)
Is this because I only enabled Proguard for the app and not the other in-workspace projects HE and ABS?
I am using the default proguard-project.txt in the sdk and did not add any additional rules.
ProGuard is a tool to help minify, obfuscate, and optimize your code. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications.
By default, this file is located at the root of the module (next to the build. gradle file).
In the obfuscation step, ProGuard renames classes and class members that are not entry points. In this entire process, keeping the entry points ensures that they can still be accessed by their original names. The preverification step is the only step that doesn't have to know the entry points.
R8 is having a faster processing time than Proguard which reduces build time. R8 gives better output results than Proguard. R8 reduces the app size by 10 % whereas Proguard reduces app size by 8.5 %. The android app having a Gradle plugin above 3.4.
No you do not.
Use these rules to keep the referenced classes un-obfuscated.
-keep class com.actionbarsherlock.** {*;}
-keep class org.holoeverywhere.** {*;}
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