【问题标题】:Execution failed for task ':app:dexDebug' android error任务 ':app:dexDebug' android 错误执行失败
【发布时间】:2016-09-02 22:27:58
【问题描述】:

我知道之前有人问过这个问题,但我仍然没有得到答案。代码运行正常,但是当我尝试将其与 firebase 集成时,我开始收到此错误。

错误:任务 ':app:dexDebug' 执行失败。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_25\bin\java.exe'' 完成非零退出值 2

我尝试过构建清洁项目,但没有一个有效。这是我的 gradle 文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "in.protechlabz.www.sns"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    }

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.google.android.gms:play-services:8.3.0'
    compile 'com.google.android.gms:play-services-ads:8.3.0'
    compile 'com.google.android.gms:play-services-identity:8.3.0'
    compile 'com.google.android.gms:play-services-gcm:8.3.0'
    compile 'com.firebase:firebase-client-android:2.3.1'
}

【问题讨论】:

    标签: java android gradle


    【解决方案1】:

    试试这个 关闭 Android Studio,然后重新启动您的计算机。然后重新启动AS

    【讨论】:

      【解决方案2】:

      其实我已经解决了这个问题我删除

      compile 'com.google.android.gms:play-services:8.3.0'
      

      从依赖项中,然后添加以下行

      packagingOptions {
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/LICENSE-FIREBASE.txt'
          exclude 'META-INF/NOTICE'
      }
      

      它消除了错误。所以感谢您的支持

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-05-23
        • 2015-10-20
        • 2015-08-23
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多