简体   繁体   English

使用Proguard后,Android Apk无法正常工作

[英]Android Apk not working after using proguard

I'm new to proguard, and I got an issue that I don't know how to fix. 我是proguard的新手,但遇到一个我不知道如何解决的问题。 I was able to create a signed apk of my app using proguard and to install it on my device, but when I try to launch the app I get: 我能够使用proguard创建一个签名的应用程序apk并将其安装在我的设备上,但是当我尝试启动该应用程序时,我得到了:

java.lang.RuntimeException: Unable to instantiate application test.myapp.first.com.CustomApplication: java.lang.ClassNotFoundException: Didn't find class "test.myapp.first.com.CustomApplication" on path: DexPathList[[zip file "/data/app/test.myapp.first.com-2/base.apk"],nativeLibraryDirectories=[/data/app/test.myapp.first.com-2/lib/arm, /data/app/test.myapp.first.com-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]

I tried to use -keep class in order to exclude the class and also Activity/Application subclasses from the obfuscation, and yes, in the android manifest the path to the application class is the full package path. 我试图使用-keep类以便从混淆中排除该类以及Activity / Application子类,是的,在android清单中,应用程序类的路径是完整的包路径。 I've decompiled the signed apk and actually the java class is placed in the correct path. 我已经反编译了签名的apk,实际上将java类放置在正确的路径中。

Any idea on how I can fix it? 关于如何解决它的任何想法吗?

Thanks 谢谢

尝试使用sdk中的proguard配置,它位于tools/proguard/ ,例如proguard-android-optimize.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM