我的 Gradle 文件中有以下依赖项:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "packagename"
minSdkVersion 10
targetSdkVersion 23
}
sourceSets {
main {
jni.srcDirs = []
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.0.1'
compile files('libs/FLurry_3.2.2.jar')
compile files('libs/pixel-perfect-collision.jar')
compile files('libs/twitter4j-core-3.0.3.jar')
compile project(':zip_file')
compile project(':andEngine')
compile project(':andEnginePhysicsBox2DExtension')
compile project(':downloader_library')
compile project(':viewPagerLibrary')
compile 'com.google.android.gms:play-services:8.1.0'
compile 'org.apache.commons:commons-lang3:3.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
}
在构建 gradle 文件时出现以下错误:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
为了解决这个错误,我已经添加了 multidex 依赖:
compile 'com.android.support:multidex:1.0.1'
还在循环..
已编辑:问题已经解决,所以不要尝试复制它,解决方案如下..!!
希望得到帮助!
谢谢。
最佳答案
你应该添加
multiDexEnabled true
在build.gradle
defaultConfig {
applicationId 'pkg'
minSdkVersion
targetSdkVersion
versionCode
versionName
// Enable MultiDexing: https://developer.android.com/tools/building/multidex.html
multiDexEnabled true
}
关于android - 意外的顶级异常 : com. android.dex.DexIndexOverflowException : method ID not in [0, 0xffff]:65536,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32836059/