开发者社区> 问答> 正文

andoird 5.0以上真机调试报错。?报错

android studio用数据线真机调试,5.0一下的版本一切正常。5.0开始就会报错,居然报ClassNotFoundException,我也是无语了。但是如果在5.0一下run之后生成的apk包可以在任何版本安装也不会报错。是不是5.0开始调试有一些特别的地方,大家有没有遇到过?求指点迷津

报错日志大致如下:其中xxx...用于隐藏真实项目包信息

 E/AndroidRuntime: FATAL EXCEPTION: main
 Process: com.xxx.xxxxx, PID: 22797
 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.xxx.xxxxx/com.xxx.xxxx.reserve.XxxActivity}: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxxx.reserve.XxxActivity" on path: DexPathList[[zip file "/data/app/com.xxx.xxxxx-2/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxxxx-2/lib/arm, /vendor/lib, /system/lib]]
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2241)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
 at android.app.ActivityThread.access$800(ActivityThread.java:154)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:135)
 at android.app.ActivityThread.main(ActivityThread.java:5275)
 at java.lang.reflect.Method.invoke(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:372)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
  Caused by: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxxx.reserve.XxxActivity" on path: DexPathList[[zip file "/data/app/com.xxx.xxxxx-2/base.apk"],nativeLibraryDirectories=[/data/app/com.xxx.xxxxx-2/lib/arm, /vendor/lib, /system/lib]]
 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
 at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)?
 at android.app.ActivityThread.access$800(ActivityThread.java:154)?
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)?
 at android.os.Handler.dispatchMessage(Handler.java:102)?
 at android.os.Looper.loop(Looper.java:135)?
 at android.app.ActivityThread.main(ActivityThread.java:5275)?
 at java.lang.reflect.Method.invoke(Native Method)?
 at java.lang.reflect.Method.invoke(Method.java:372)?
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:909)?
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)?
Suppressed: java.lang.ClassNotFoundException: Didn't find class "com.xxx.xxxx.reserve.XxxActivity" on path: DexPathList[[zip file "/data/data/com.xxx.xxxxx/app_curRes/BaiduNaviSDK_3.1.1.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
 at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Suppressed: java.lang.ClassNotFoundException: com.xxx.xxxx.reserve.XxxActivity
 at java.lang.Class.classForName(Native Method)
 at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
 at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 14 more
  Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

展开
收起
爱吃鱼的程序员 2020-06-09 12:38:28 762 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    感觉和instantrun有关。我的觉得也是,那要怎么解决呢?分包的问题吧一开始查了些资料有说到分包,我也做了分包处理,还是不行~我是没有遇到过,4.x,5.x都没啥问题

    2020-06-09 12:38:45
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载