2015-12-18 31 views
5

クリーンプロジェクト後 - >私はエラーを下回るエラー:タスク ':app:transformClassesWithDexForDebug'の実行に失敗しました。 > com.android.build.api.transform.TransformException ..ゼロ以外の終了値3

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 3

を取得していますプロジェクト私のアンドロイドプロジェクトをリビルドGradleの:

apply plugin: 'com.android.application' 

    android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
     applicationId "com.myapplicationname.app" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
    } 
    useLibrary 'org.apache.http.legacy' 

} 

    dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.0.1' 
    compile 'com.android.support:design:23.0.1' 
    compile 'com.google.android.gms:play-services:8.3.0' 
    compile files('libs/gcm.jar') 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'org.apache.httpcomponents:httpcore:4.4.4' 
    compile('org.apache.httpcomponents:httpmime:4.3.6') { 
     exclude module: "httpclient" 
    } 
    //facebook sdk 
    compile 'com.facebook.android:facebook-android-sdk:4.7.0' 
    compile 'org.apache.httpcomponents:httpcore:4.4.3' 

    compile 'com.paypal.sdk:paypal-android-sdk:2.12.4' 
    //facebook sdk 
    compile 'com.facebook.android:facebook-android-sdk:4.7.0' 

} 

私はすでにthisthisを参照してください、しかし、私は、私はそれを解決するために行う必要があり、私のsolution.Whatを持っていないことができます。

答えて

15

私はちょうど私のgradleのようなファイルを更新します。チャームのようなこの作品!

私は私のGradleのコードの下に追加:

dexOptions { 
     javaMaxHeapSize "4g" //specify the heap size for the dex process 
     preDexLibraries = false //delete the already predexed libraries 
    } 

マイのGradleを更新:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.1" 

    defaultConfig { 
     applicationId "com.myapplicationname.app" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 
    //====================Add below two line============= 
    dexOptions { 
     javaMaxHeapSize "4g" //specify the heap size for the dex process 
     preDexLibraries = false //delete the already predexed libraries 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
    } 
    useLibrary 'org.apache.http.legacy' 

} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.0.1' 
    compile 'com.android.support:design:23.0.1' 
    compile 'com.google.android.gms:play-services:8.3.0' 
    compile files('libs/gcm.jar') 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'org.apache.httpcomponents:httpcore:4.4.4' 
    compile('org.apache.httpcomponents:httpmime:4.3.6') { 
     exclude module: "httpclient" 
    } 
    //facebook sdk 
    compile 'com.facebook.android:facebook-android-sdk:4.7.0' 
    compile 'org.apache.httpcomponents:httpcore:4.4.3' 

    compile 'com.paypal.sdk:paypal-android-sdk:2.12.4' 
    //facebook sdk 
    compile 'com.facebook.android:facebook-android-sdk:4.7.0' 

} 
+0

ありがとう – susemi99

+3

私の人生を保存しますが、f * ckがその問題である理由とコードがそれを解決する理由について説明してください。感謝 –

+0

@ susemi99:あなたは歓迎です – pRaNaY

2

可能な解決策は、あなたが使用しているプレイサービスを指定することができ

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

のような例:

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

これはメソッドの総量を減らします。

+0

はい、ありがとうございます! –

関連する問題