AndroidStudio的 Caused by java.lang.ClassNotFoundException Didn't find class com.gizwits.opensource.a
来源:互联网 发布:最优化方法袁亚湘孙文 编辑:程序博客网 时间:2024/05/21 05:23
问题的出现
错误代码:
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gizwits.opensource.appkit/com.gizwits.opensource.appkit.UserModule.GosUserLoginActivity}: java.lang.ClassNotFoundException: Didn't find class "com.gizwits.opensource.appkit.UserModule.GosUserLoginActivity" on path: DexPathList[[zip file "/data/app/com.gizwits.opensource.appkit-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.gizwits.opensource.appkit-1, /system/lib]]
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.gizwits.opensource.appkit.UserModule.GosUserLoginActivity" on path: DexPathList[[zip file "/data/app/com.gizwits.opensource.appkit-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.gizwits.opensource.appkit-1, /system/lib]]
不直观.我们直接展示图片:
错误原因的分析:
我们可以看到ava.lang.ClassNotFoundException: Didn’t find class”包名”在这个路劲DexPathList.
解决的方法
第一点
not find class 这个类,是不是在不存在这个类,我们首先是查看在这个包名下面是不是存在这个这个类.
最后我们查找的结果是这个类是确实存在的,排除这个问题:
第二点
在清单文件中注册这个类的时候是不是存在错误
一般进入我们这个类中,复制这个类的引用,在清单文件中重新注册,
这些都没错的话,那就是multidex这个上面了!具体如下:
重点来了
知识学习: http://www.jianshu.com/p/dd90d7e7c691
在android5.0之前,每一个android应用中只会含有一个dex文件,但是因为Android系统本身的BUG,使得这个dex的方法数量被限制在65535之内,这就是著名的”64K(641024)”*事件。为了解决这个问题,Google官方推出了这个类似于补丁一样的support-library。关于这个库的详细使用,可以参考官方文档,当然使用起来也会有些坑的,美团填坑记或者这位老兄。使用这个库后,我们的APP不再只会仅有一个dex文件,可能会产生多个dex文件,这样就避免了64K问题。
也就是说在5.0之前是只有一个dex文件的,有的时候我们会遇到65535的方法数量的限制,今天才知道这就是64k事件,支持库的产生不会只有一个dex,有几个dex.从提示信息来看,是因为DexLoader加载这个类的时候没有找到这个类,也就是说在DexPathlist中所有的dex文件都没有你要的这个类,也许就是因为你这个类被打包到了其他dex里,但是你没有在application里面安装
具体就是看我们是不是开启了muiltidex,这个也就是我们出现64k问题时候的解决方法:
我们可以看到我们是开启了!接下来就是在我们的application中不在是集成Application,而是继承MultiApplication这个类.
运行时权限
直接上连接:
http://blog.csdn.net/yanzhenjie1003/article/details/52503533
- AndroidStudio的 Caused by java.lang.ClassNotFoundException Didn't find class com.gizwits.opensource.a
- Caused by: java.lang.ClassNotFoundException: Didn't find class "com.***.client.v1.Mai
- Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.xxxxx.MainActivity" on p
- Caused by: java.lang.ClassNotFoundException: Didn't find class "com.zyh.testswiperefresh.MainActivit
- Caused by: java.lang.ClassNotFoundException: Didn't find class "com.***.client.v1.Mai
- Android studio报:Caused by: java.lang.ClassNotFoundException: Didn't find class "xhs.com.view.ParentV
- Android studio报:Caused by: java.lang.ClassNotFoundException: Didn't find class "xhs.com.view.ParentV
- Caused by: java.lang.ClassNotFoundException: Didn't find class "com.yinuo.parking.app.MyApplication"
- Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.ViewPager"
- Caused by: java.lang.ClassNotFoundException: Didn't find class "XXX" on path: DexPathList[[zip file
- Caused by: java.lang.ClassNotFoundException: Didn’t find class on path apk Android Studio解决方案
- 报错Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.PagerTabStrip"
- 低级错误:Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.view.ViewPag
- Caused by: java.lang.ClassNotFoundException: Didn't find class "net.oschina.app.AppContext" on path:
- Caused by: java.lang.ClassNotFoundException: Didn't find class "net.grandcentrix.tray.provider.TrayC
- Caused by: java.lang.ClassNotFoundException: Didn't find class ""on path: DexPathList[[zip file "/da
- Caused by: java.lang.ClassNotFoundException: Didn't find class "包名" on path
- 项目报错:Caused by: java.lang.ClassNotFoundException: Didn't find class "..."on path: DexPathList
- 学生成绩之和
- Maven学习笔记(七)——Maven工程的继承
- Selenium Webdriver学习记录(一):环境搭建(Java+Maven+Eclipse+Selenium3.x)+第一个测试demo+部分问题解决
- GeoServer发布PostGIS数据
- 查询pci卡支持的特性
- AndroidStudio的 Caused by java.lang.ClassNotFoundException Didn't find class com.gizwits.opensource.a
- ccache 优化C++编译速度
- 配置jdk,maven环境变量
- ActvieMQ简单使用
- 常见的错误码
- C语言 可变参数
- 最近公共祖先LCA--Tarjan算法
- INSERT 语句与 FOREIGN KEY 约束"XXX"冲突。该冲突发生于数据库"XXX",表"XXX", column 'XXX。
- leetcode 395. Longest Substring with At Least K Repeating Characters 最长K个数量的字符 + DFS深度优先搜索