1.Java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxx.App"
09-29 15:31:41.282 30049-30049/com.xxx.xxx E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxx.xxx, PID: 30049
java.lang.RuntimeException: Unable to instantiate application com.xxx.xxxx.App: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxx.App" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-1/lib/arm64, /data/app/com.xxx.xxx-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:806)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5429)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1574)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6237)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxx.App" on path: DexPathList[[zip file "/data/app/com.xxx.xxx-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxx-1/lib/arm64, /data/app/com.xxx.xxx-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newApplication(Instrumentation.java:993)
at android.app.LoadedApk.makeApplication(LoadedApk.java:800)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5429)?
at android.app.ActivityThread.-wrap2(ActivityThread.java)?
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1574)?
at android.os.Handler.dispatchMessage(Handler.java:102)?
at android.os.Looper.loop(Looper.java:163)?
at android.app.ActivityThread.main(ActivityThread.java:6237)?
at java.lang.reflect.Method.invoke(Native Method)?
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)?
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)?
原因:没有使用秘钥对APK进行签名,而是直接从AS的工程模块下的build里调试时生成的APK。
解决方案:重新编译并使用签名工具。