java.lang.ClassNotFoundException: Didn’t find class on path: dexpathlist

ref: https://stackoverflow.com/questions/22399572/java-lang-classnotfoundexception-didnt-find-class-on-path-dexpathlist?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

I should understand the problem by just seeing

dex errors

But it took a half day to fix the issue.
I fix this by following android developers page’s instruction:https://developer.android.com/studio/build/multidex.html

First add this to gradle.build file :

defaultConfig {
    ...
    minSdkVersion 14
    targetSdkVersion 21
    ...

    // Enabling multidex support.
    multiDexEnabled true
}

 dependencies {
     compile 'com.android.support:multidex:1.0.0'
 }

Then extend Application class (or declare the application class in 

AndroidManifest.xml

 or override 

attachBaseContext()

 function with the 

MultiDexApplication

 class as instructed on the above link.

That’s all and it solved the problem.

未經允許不得轉載:GoMCU » java.lang.ClassNotFoundException: Didn’t find class on path: dexpathlist