Android 合并索引时出错

Android 合并索引时出错,android,Android,无法合并索引 错误:任务的执行失败 “:app:transformDexArchiveWithExternalLibsDexMergerForDebug”。 java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException:无法合并 指数 build.grandle文件 apply plugin: 'com.android.application' android { compileSdkV

无法合并索引

错误:任务的执行失败 “:app:transformDexArchiveWithExternalLibsDexMergerForDebug”。 java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException:无法合并 指数

build.grandle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
//    buildToolsVersion "27.1.1"
    defaultConfig {
        applicationId "com.osan.user.askprediction"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 3
        versionName "1.1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation('com.payumoney.sdkui:plug-n-play:1.0.0') {
        transitive = true;
        exclude module: 'payumoney-sdk'
    }
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.google.android.gms:play-services-places:15.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.payumoney.core:payumoney-sdk:7.0.1'
    testCompile 'junit:junit:4.12'
    implementation files('libs/okhttp-2.5.0.jar')
    implementation files('libs/okio-1.6.0.jar')
    implementation 'com.dinuscxj:circleprogressbar:1.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.paytm:pgplussdk:1.1.2'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
}
configurations {
    all*.exclude group: 'com.android.volley'
}
apply plugin: 'com.google.gms.google-services'
试一试

在你的
app/build.gradle

也将此库添加到您的依赖项中

compile 'com.android.support:multidex:1.0.1'

请参阅上的文件above@OsanKumarSingh很抱歉。。同一条线解决了我的问题。添加此项后是否进行了清理和重建??清理和重建后信息:Gradle任务[clean,:app:assembleDebug]错误:将字节码转换为dex时出错:原因:com.android.dex.dex异常:多个dex文件定义Lokio/Segment;错误:com.android.dex.DexException:多个dex文件定义Lokio/Segment;错误:你能试试最后一件事吗。。转到构建--在应用程序类中创建项目并选中@OsanKumarSinghdo
@Override protected void attachBaseContext(Context Context){super.attachBaseContext(Context);MultiDex.install(this);}
无法工作@ninini0112请查看此内容,\n无法为我工作
compile 'com.android.support:multidex:1.0.1'