Android 解决因Android版本太低,导致Could not find class 错误的解决办法
2018-01-02 15:31
891 查看
近期项目在测试过程中,在Android 5.0版本的测试中(以前APP测试未出现),GreenDao 出现 Could not find class 'org.greenrobot.greendao.database.StandardDatabase' 错误
查阅资料后发现是Android 的4.4分包机制导致,也就是说当你的DEX文件方法超过65536后应用就已经饱满了。所以就会出现以上错误。
解决方法:
1.在grade 中引入 如图所示包
2.在grade中设置
multiDexEnabled为true
3.将自己的Application类继承MultiDexApplication类,
4.实现attachBaseContext方法,初始化MultiDex.install
实现以上步骤之后就可以解决分包问题了,想要了解的更加具体可以看看这篇文章 Android 使用android-support-multidex解决Dex超出方法数的限制问题,让你的应用不再爆棚 讲解的很详细
查阅资料后发现是Android 的4.4分包机制导致,也就是说当你的DEX文件方法超过65536后应用就已经饱满了。所以就会出现以上错误。
解决方法:
1.在grade 中引入 如图所示包
2.在grade中设置
multiDexEnabled为true
3.将自己的Application类继承MultiDexApplication类,
4.实现attachBaseContext方法,初始化MultiDex.install
实现以上步骤之后就可以解决分包问题了,想要了解的更加具体可以看看这篇文章 Android 使用android-support-multidex解决Dex超出方法数的限制问题,让你的应用不再爆棚 讲解的很详细
相关文章推荐
- 关于android编程中遇到的Could not find class 'com.swetake.util.Qrcode错误的原因及解决办法
- 关于android编程中遇到的Could not find class 'com.swetake.util.Qrcode错误的原因及解决办法
- Could not find the main class.program will exit和java.lang.UnsupportedClassVersionError 错误的解决办法
- could not find class file. make sure the file is compilable 解决办法
- 举例说明关于android编程中遇到的Unable to find explicit activity class错误的原因及解决办法
- 关于错误提示:could not find a part of path “X:\”的解决办法
- eclipse下配置tomcat错误导致启动tomcat报错,Could not find main class
- VS2008在64位Windows平台上编译ArcEngine导致HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)错误的解决办法
- [转]VS2008在64位Windows平台上编译ArcEngine导致HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)错误的解决办法
- 解决Android AVD的方向键DPAD不能用的问题/could not find class
- Android项目导入时,出现的Could not write file 。。。。。。.classpath错误解决办法
- VS2008在64位Windows平台上编译ArcEngine导致HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)错误的解决办法。
- Android 开发之 HttpClient Class can not find 之解决办法
- Android项目导入时,出现的Could not write file 。。。。。。.classpath错误解决办法
- Android项目导入时,出现的Could not write file 。。。。。。.classpath错误解决办法
- 运行android程序,Could not find *.apk的解决办法
- 双击jar文件出现Could not find main class的解决办法
- 记录一下,关于错误提示:could not find a part of path “X:\”的解决办法
- Android开发错误——Could not find class
- Could not find *.apk在android1.5中的解决办法