Didn't find class on path DexPathList

后端 未结 1 640
时光取名叫无心
时光取名叫无心 2021-01-15 21:35

I was attempting to update my project to targetSdk 23, but I decided I wasn\'t up for it given all the deprecations. I didn\'t want to go through it so I reverted to an olde

相关标签:
1条回答
  • 2021-01-15 22:12

    Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536, including Android framework methods, library methods, and methods in your own code. Getting past this limit requires that you configure your app build process to generate more than one DEX file, known as a multidex configuration.

    1. Change your Gradle build configuration to enable multidex
    2. Modify your manifest to reference the MultiDexApplication class

    Modify your app Gradle build file configuration to include the support library and enable multidex output .

        android {
        compileSdkVersion 21
        buildToolsVersion "21.1.2"
    
        defaultConfig {
            ...
            minSdkVersion 14
            targetSdkVersion 21
            ...
    
            // Enabling multidex support.
            multiDexEnabled true
        }
        ...
    }
    
    dependencies {
      compile 'com.android.support:multidex:1.0.0'
    }
    

    For more details you can visit

    DexIndexOverflowException Only When Running Tests

    0 讨论(0)
提交回复
热议问题