2017-04-06 27 views
1

アンドロイドスタジオでアンドロイドプロジェクトで作業しましたが、グラードビルドを起動して次のエラーが表示されました。誰もが問題Androidエラー:タスク ':app:transformClassesWithDexForDebug'の実行に失敗しました

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 '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3

build.gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.stage.lookara" 
     minSdkVersion 16 
     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/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
    } 
    } 

    dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:design:23.1.1' 
    compile files('libs/twitter4j-core-4.0.4.jar') 
    compile files('libs/slider.jar') 
    compile 'com.google.android.gms:play-services:8.3.0' 
    compile 'com.facebook.android:facebook-android-sdk:4.0.0' 
    compile 'com.etsy.android.grid:library:1.0.5' 
    compile 'com.baoyz.swipemenulistview:library:1.3.0' 
    compile files('libs/universal-image-loader-1.9.5.jar') 
    compile 'com.github.darsh2:MultipleImageSelect:v0.0.3' 
    compile files('libs/pherialize-1.2.1.jar') 
    compile 'com.wang.avi:library:2.1.3' 
    compile 'com.mikhaellopez:circularprogressbar:1.1.1' 
    compile 'com.android.support:recyclerview-v7:23.1.1' 
    compile 
    'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1' 
    compile 'com.felipecsl:gifimageview:2.1.0' 
    } 

    repositories { 
    jcenter() 
    } 

    dependencies { 
    compile 'org.adw.library:discrete-seekbar:1.0.1' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:19.+' 
    compile 'org.jsoup:jsoup:1.7.3' 
    } 
+0

DEXを実装し、 'この行を入れては中true'をしmultiDexEnabledあなたのbuild.gradle –

+1

このリンクを参照してくださいhttp://stackoverflow.com/a/33718050/6644676。 – Furqan

+0

IDEの右下にある「Gradle console」を開くと、問題に関する詳細情報が表示されます。 – azizbekian

答えて

1

あなたは全体、Googleがサービスライブラリを再生コンパイルされています

コンパイル時に 64K reference limit'を横断することができます
compile 'com.google.android.gms:play-services:8.3.0' 

を...

this

を参照してください。

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

私も本当にあなた場合compile 'com.google.android.gms:play-services:10.2.1'

第二プレイサービスウェイの最新バージョン

を使用することをお勧め:ちょうどあなたがSelectively compiling APIs into your executable

などができるライブラリからいくつかのサービスを使用しますライブラリ全体を使用したい:アプリケーションでMultidexを有効にする。あなたのGradleで

android { 
    defaultConfig { 
     ... 
     minSdkVersion 15 
     targetSdkVersion 25 
     multiDexEnabled true 
    } 
    ... 
} 

dependencies { 
    compile 'com.android.support:multidex:1.0.1' 
} 

Applicationクラスで:

public class MyApplication extends SomeOtherApplication { 
    @Override 
    protected void attachBaseContext(Context base) { 
    super.attachBaseContext(base); 
    MultiDex.install(this); 
    } 
} 

がマニフェストでアプリケーションクラスを定義します。

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.myapp"> 
    <application 
      android:name="android.support.multidex.MultiDexApplication" > 
     ... 
    </application> 
</manifest> 
+0

ありがとうございます。 – Sasi

0

何であるか私を助けてきれいな最初のを試してみてください。

動作しない場合は、build.gradleファイルにmultiDexEnabledを追加してください。

defaultConfig { 
    multiDexEnabled true 
} 

この参照:com.android.build.transform.api.TransformException

関連する問題