且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“ClassNotFoundException:在路径 DexPathList 上没有找到类";在 API 19

更新时间:2021-09-19 05:52:48

我终于设法解决了这个问题.原来,虽然我在 gradle 设置中启用了 MultiDex

I finally managed to solve the problem. Turned out that while I had enabled MultiDex in the gradle settings with

defaultConfig {
   multiDexEnabled true
   ...
}

并使用

depenencies {
   ...
   compile 'com.android.support:multidex:1.0.1'
   ...
}

我忘记将它添加到 AndroidManifest.xml 中

I had forgotten to add it in the AndroidManifest.xml with

<application
   ...
   android:name="android.support.multidex.MultiDexApplication"
   ...
>
   ...
</application>

添加该部分后,它现在可以在 API 级别 19 上运行.

After adding that part it now works on API level 19.