I had a similar problem and wanted to add only a few bits.
Resources are NOT deleted by ProGuard. If you just unzip your apk, you will see that image files still exist.
The problem is that Webkit FileLoader will try to load your R $ drawable class using reflection. If you do not add the keep rule to the proguard.cfg file, this class will be renamed, so Webkit will not be able to load your resource.
By placing the file in the resource folder, you bypass the class R system and everything will work.
This is not a solution, though, for example, if you want to use different resources for different densities.
I suggest you just add a very basic keep rule to preserve R inner classes and fields:
-keepclassmembers class **.R$* { public static <fields>; } -keep class **.R$*
ninniuz Jan 19 '12 at 12:01 2012-01-19 12:01
source share