Ike MA & Abby Life Experience, Programming & Consumer Electrics



In my developing, I use a 3rd party library. When I package the Apk file, I use ProGuard to obfuscate the source code.


I found that the obfuscated app will crash when calling the 3rd party library, with seeing the logs, I found that the app met an exception because the app can’t find the specific 3rd party library.



That’s becuase ProGuard has changed the Class name, Field Name and Function name, then caused this exception that the specific library can’t be found. You can simply try to use -keep to keep the class that we don’t want it to be obfuscated.


In the ProGuard.cfg, you can add the following code, replace theClassToKeep to your Class name, for example com.ikecode:

-keep class theClassToKeep.** {*;}


Be sure to use ** as the Wildcard.

Loading comments...