且构网

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

在路径DexPathList上找不到类

更新时间:2021-11-08 19:19:48


Android应用程序(APK)文件包含Dalvik可执行文件(DEX)文件形式的
可执行字节代码文件,其中包含用于运行应用程序的已编译
代码。 Dalvik Executable规范将
限制在单个DEX
文件中可以引用的方法总数限制为65,536,包括Android框架方法,库方法,
和您自己代码中的方法。超过此限制要求将应用程序构建过程中的
配置为生成多个DEX
文件,称为multidex配置。

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. 更改您的Gradle构建配置以启用multidex

  2. 修改清单以引用MultiDexApplication class

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

修改您的应用Gradle构建文件配置,以包括支持库并启用multidex输出。 em>

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仅在运行测试时