This issue might be related to some SO questions as i searched a lot here, but no any post helped me. My app running when it is unsigned but it crashes instantly when i run the
About Proguard
Proguard basically makes your code smaller and harder to reverse engineer by doing two things:
About Your Issue
It looks like something is using Java reflection to lookup a field named REPLACE, but this field got obfuscated by proguard.
From your posted stack trace, this:
com.a.g.<init>(Unknown Source:94)
is the code that is making the reflective call.
So what the heck is com.a.g.<init>
? It's the obfuscated name of a class.
The <init>
tells me this is a class constructor of some sort.
But in order to figure out what a
and g
are, you'd need some sort of mapping between the real symbol and the one that proguard assigned it.
Solution
When proguard runs, it generates a symbol mapping file. You can unobfuscate your stack trace using the retrace.sh script (or retrace.bat if you're developing on Windows) that comes with the proguard tool packaged with the Android SDK if you've still got this mapping file and figure out where this is in your code.
Something like:
<androidsdkroot>/tools/proguard/bin/retrace.sh -verbose mapping.txt stacktrace.txt > out.txt
Where:
Once you've figured that out, you'll need to add a keep rule to your proguard config file to prevent this from being obfuscated. Or, get rid of the reflective code if you can do that instead.
Lastly, if the code that is making the reflective call is from a library you don't own, I would go look at the documentation for that library and see if it calls out any keep rules you should be adding to your proguard config file and add them.
Please see the Android Shrink Code documentation for more information on decoding an obfuscated stack trace.