2017-08-03 11 views
0

試して。 'com.android.application'apkビルドエラーです。の解き方?実行は、タスクに失敗しました「:アプリ:transformClassesWithDexForDebug」:実行がタスクに失敗しました「:アプリ:transformClassesWithDexForDebug」APKビルドが、エラー</p> <p>エラーに

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "my packagename" 
     minSdkVersion 19 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    productFlavors { 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'gun0912.ted:tedpermission:1.0.2' 
    testCompile 'junit:junit:4.12' 
} 

何が間違っている:

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

のGradleファイル

は、プラグインを適用しますか?

+0

セクション 'releaseCompileClasspath'は' gradlew app:dependencies'の出力からです。 – DeKaNszn

+0

https://stackoverflow.com/a/33430306/3395198 –

答えて

0

方法が多すぎます。デックスのための方法は65536しかない。だから、 、この

<application 
    android:name=".Multi_Dex" 
    android:allowBackup="true" 
    android:icon="@drawable/logo" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@style/AppTheme"> 

ノートを追加するには、manifiestファイルになりました。この

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

のような1つのクラスを作成します

android {  
defaultConfig { 
    // Enabling multidex support. 
    multiDexEnabled true 
} 
} 
dependencies { 
compile 'com.android.support:multidex:1.0.0' 
} 

を以下のようmultidexを有効にします。あなたの場合プロジェクトはマルチディックス用に構成されていますminSdkVersion 20以下でAndroid 4.4(APIレベル20)以下のターゲットデバイスにデプロイすると、Android Studioはインスタント実行を無効にします。

関連する問題