java.lang.NoClassDefFoundError: android.support.v4.app.NavUtilsJB error when adding new module in Android Studio

一个人想着一个人 提交于 2019-12-01 09:37:36

I found solution for this problem. I was using multidexing and it is available only in Lolipop devices, so, to use it in pre-Lolipop devices I needed to add this line

compile 'com.android.support:multidex:1.0.0' to build.gradle file

and this one line android:name="android.support.multidex.MultiDexApplication" to AndroidManifest.xml in <appplication tag.

For me - now everything works fine.

EDIT: instead of adding line to android:name in manifest, you can add multiDexEnabled = true to gradle file in defaultConfig.

Based on the stack trace, I would strongly suspect a problem with support library version mismatches. For example, it appears that the android-color-picker library relies on a quite outdated version of the support library (updated over a year ago). Perhaps your main project is using a more recent version of the support library? In order to avoid this crash, I would recommend reconfiguring the android-color-picker library to use the same version of the support library that you are using elsewhere in your project.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!