解决gradle问题时出错...错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败 [英] Error resolving gradle issue...Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'

查看:85
本文介绍了解决gradle问题时出错...错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行应用程序时遇到问题,它显示错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败.

I am facing issue while running the app, it shows Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:无法合并dex错误. 我尝试了所有可用的答案,但是找不到解决我的问题的方法,因此请帮助我.我尝试过关闭和重建项目,而且所有库版本都无法解决我的问题.预先感谢.

java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex error . i tried all the available answer but cant find one to solve my issue, so kindly help me with it. I have tried cleaing and rebuilding project, also all libraries versions are same cant solve my issue yet. Thanks in advance.

我的build.gradle:

My build.gradle:

android {
    compileSdkVersion 27
    defaultConfig {

        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}
configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
    all*.exclude group: 'com.google.android.gms', module: 'play-services'
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.github.johnpersano:supertoasts:2.0'
    implementation 'com.github.mmoamenn:ProgressImage_Android:0.0.2'
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'
    implementation 'jp.wasabeef:blurry:2.1.1'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.google.code.gson:gson:2.8.0'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'com.github.stfalcon:smsverifycatcher:0.3.1'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'in.gauriinfotech:commons:1.0.8'
    implementation 'com.github.chenupt.android:springindicator:1.0.2@aar'
    implementation 'com.google.android.gms:play-services-places:15.0.0'
    implementation 'com.google.android.gms:play-services-location:15.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    implementation 'com.google.firebase:firebase-core:15.0.0'
    implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'

MY project.gradle:

MY project.gradle:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

推荐答案

对我有用的是,我将Play服务和基本版本恢复为11.8.0,现在可以正常使用了.

What worked for me is i reversed the play services and fire base versions to 11.8.0 and it is working fine now.

这篇关于解决gradle问题时出错...错误:任务':app:transformDexArchiveWithExternalLibsDexMergerForDebug'的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆