我在应用程序中添加 payumoney 时遇到错误。这是错误 -
意外的顶级异常:
`com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:473)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:161)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
atcom.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java0)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)`
这是 build.gradle(app) 文件代码
apply plugin: 'com.android.application'
android { compileSdkVersion 23 buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xxxxxxxxxxx"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
repositories {
maven { url "https://jitpack.io" }}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.3'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.picasso:picasso:2.3.2'
compile project(':viewPagerLib')
compile project(':PayU-release')
compile project(':sdkui')
compile 'com.google.android.gms:play-services:8.4.0'}
这里是 build.gradle(project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}
allprojects {
repositories {
jcenter()
}}
task clean(type: Delete) {
delete rootProject.buildDir}
如果我在 build.gradle 中使用 multidex true,则错误已解决,但应用程序在第一个屏幕上崩溃。