The previous article describes Android using Proguard code obfuscation technology, but for some of the items that introduced third-party jar packages may be in error when exporting, you need to do some research on the Proguard configuration file to solve the problem.
Proguard code obfuscation after exporting warning:can ' t find referenced class
First, this time the simplest solution:
For some third-party jars, there may have been code confusion, which should be maintained here, such as Baidu's map package jar. Keep the jar, avoid confusing the code as follows:
-keep class com.baidu.mapapi.** {*;}
Does not confuse all the code in the Com.baidu.mapapi package, the class name, method, variable, and so on.
Second, if it is still an error, please refer to this article: http://blog.csdn.net/u_xtian/article/details/7495023
Thank the author here, solve my problem, in fact, the final solution is very simple, add two lines is good:
In fact, can not find the reference to this class is a third-party package inside, and many times we just need to disrupt their own code on the line, the third-party package of the code is to be disrupted on the tube.
We can use:
-dontwarn com.xx.bbb.**
-keep class com.xx.bbb.** {*;}
Parameters to keep classes in third-party libraries without confusion,-dontwarn and-keep, meaning to keep com.xx.bbb.** all the classes and all the methods in this package are not confused, and then called Proguard do not warn you can't find com.xx.bbb.** A reference to the class within the package .
After configuration, repack, everything ok! And the program can run correctly.
The above is the error I encountered when writing a confusing configuration file solution
I developed a profile that uses ant bulk packaging obfuscation in the project has uploaded click Open link
http://download.csdn.net/detail/fancylovejava/8551463
Record, and then do other projects in bulk packaging when you can learn from the next!
Android code obfuscation can ' t find referenced class problem solution