this is my proguard-project.txt:
-keep class com.google.inject.** { *; }
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }
-keep class roboguice.** { *; }
-keepattributes Signature
-keepattributes *Annotation*
-keep class roboguice.**
-keep class com.google.inject.** { *; }
-keepclassmembers class * {
@com.google.inject.Inject <fields>;
@com.google.inject.Inject <init>(...);
}
-keep class javax.inject.** { *; }
-keep class javax.annotation.** { *; }
-keep class com.appmanager.ui.activities.** { *; }
-keep class com.appmanager.ui.fragments.** { *; }
I am getting 500 warnings:
http://pastebin.com/HihG9c66
How is it possible to resolve this warnning and keep the code from crashing?
The current (kept up-to-date) official list of ProGuard settings for RoboGuice is available at https://github.com/roboguice/roboguice/wiki/ProGuard
For me, the parts either not in that file or weren't default and I skipped originally, were:
-keep class com.mynamespace.MyRoboGuiceModule { *; }
-keep class com.mynamespace.SomeObjectThatGetsInjected { *; }
-dontobfuscate
I really didn't like removing obfuscation. But it makes it a lot easier to get ProGuard to work without going through every class one-by-one. (And it is one less step in mapping the stack traces from public crash reports.)
You can also add the following to the above to get it to compile, but it may still crash at runtime. So always test all codes paths in the compiled release build!
-dontwarn roboguice.**
-dontwarn org.roboguice.**