2017-11-02 2 views
3

にアンドロイドスタジオを更新した後、タスクに失敗しました、私は私のAndroidのメーカー3.0を更新すると、私はエラー実行は3.0

unable to merge with dex. 

を得るそれから私はmutiDexEnabled trueを追加してもbuild.gradlecom.android.support:multidex:1.0.1を追加しました。

Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. java.io.IOException: Can't write [C:\Users\user\AndroidStudioProjects\KnightFox-IN BUDGET\app\build\intermediates\multi-dex\debug\componentClasses.jar] (Can't read [C:\Users\user.gradle\caches\transforms-1\files-1.1\play-services-ads-lite-11.4.2.aar\9a54afd7907fee993ecc421b66ed4228\jars\classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:com/google/ads/mediation/MediationServerParameters$Parameter.class]))

build.gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion '26.0.2' 

    defaultConfig { 
     applicationId "com.copperseeds.android.kunjachamman.applicationin.budget" 
     minSdkVersion 14 
     targetSdkVersion 26 
     multiDexEnabled true 
    } 


    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' 
     } 
    } 

} 



dependencies { 
    implementation files('libs/ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar') 
    implementation fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 

    implementation 'com.android.support:appcompat-v7:26.0.0' 
    implementation 'com.android.support:support-annotations:26.0.0' 
    implementation 'com.android.support:support-v4:26.0.0' 
    implementation 'com.github.navasmdc:MaterialDesign:[email protected]' 
    testImplementation 'junit:junit:4.12' 
    implementation project(':ORMDroid') 
    implementation project(':FacebookSDK') 
    implementation project(':standOut') 
    implementation files('libs/gcm.jar') 
    implementation files('libs/google-play-services.jar') 
    implementation 'com.google.android.gms:play-services:+' 
    compile 'com.android.support:multidex:1.0.1'  
} 
+0

クリーニングプロジェクトを試しましたか? –

答えて

0

buildToolsVersion "26.0.0"試してみて、そしてちょうどAndroidのメーカーを再起動します。

は、その後、私は以下のエラーが取得しています。あなたはdependencies

を追加するとき

0

あなたのBuild.Gradle

implementation files('libs/google-play-services.jar') 

よりClear-Rebuild-Runプロジェクト

からこれを削除プレイサービスのため jarファイルを追加する必要はありません
+0

jarファイルを削除しましたが、私のために働いていません。同じエラーが再び表示されます。 – jasmin

+0

@jasminこれも削除します**実装ファイル( 'libs/gcm.jar') '** –

+0

私も削除しました。再度同じエラーが発生する – jasmin

1

のアプリケーションのビルドフォルダを削除してみてください。あなたのプロジェクトをクリーンリビルドして実行してください。 do not workより大きい場合キャッシュ/再起動を無効にします。

ハッピーコーディング!、

ステップ2すべてのビルド.gradleフォルダーを削除します:あなたのGradleで以下のコードを追加し

+0

この後に同じエラーが発生する – jasmin

0

一度、

ステップ1の手順を実行してみてください。特性,

android.enableAapt2=false 

手順3:次に、Androidプロジェクトを同期します。

+0

gradle.propertiesが表示されない場合 – jasmin

+0

プロジェクトに右クリックしてリソースバンドルを作成することができます。 **プロジェクト - >新規を右クリックします - >リソースバンドル**。 次に、** gradle **という名前のファイルを作成します。 ** gradle.properties **ファイルは、** build.gradle **ファイルのすぐ下に表示されます。次に、このコードを書きます。 –

0

あなたは+で終わるライブラリを使用しないでください。バージョンを指定する必要があります。 implementation 'com.google.android.gms:play-services:+' を構築し、その後

implementation 'com.google.android.gms:play-services:11.4.2' 

でなければなりません。Gradleのは次のようになります。

https://developer.android.com/studio/build/multidex.html:あなたは、このリンクで詳細をたどるアプリケーションクラスを拡張している場合は、アプリケーションクラスに

<application 
      android:name="android.support.multidex.MultiDexApplication" > 
     ... 
    </application> 

を拡張されていない場合は、まだマニフェストに追加する必要が

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion '26.0.2' 

    defaultConfig { 
     applicationId "com.copperseeds.android.kunjachamman.applicationin.budget" 
     minSdkVersion 14 
     targetSdkVersion 26 
     multiDexEnabled true 
    } 


    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' 
     } 
    } 

} 



dependencies { 
    implementation files('libs/ksoap2-android-assembly-2.6.0-jar-with-dependencies.jar') 
    implementation fileTree(include: ['*.jar'], dir: 'libs') 
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 

    implementation 'com.android.support:appcompat-v7:26.0.0' 
    implementation 'com.android.support:support-annotations:26.0.0' 
    implementation 'com.android.support:support-v4:26.0.0' 
    implementation 'com.github.navasmdc:MaterialDesign:[email protected]' 
    testImplementation 'junit:junit:4.12' 
    implementation project(':ORMDroid') 
    implementation project(':FacebookSDK') 
    implementation project(':standOut') 
    implementation files('libs/gcm.jar') 
    implementation files('libs/google-play-services.jar') 
    implementation 'com.google.android.gms:play-services:11.4.2' 
    compile 'com.android.support:multidex:1.0.1'  
} 
0

あなたがAndroidのスタッドに更新する必要があります。また

Do not use jars, just use the repos directly

do not use compile use implimentation

ioバージョン3.0。あなたは、あなたが追加したことを確認してくださいレポでデータバインディングを使用している場合は、また新しいのGradleラッパー

repositories { 
     maven { 
      google() 
     } 
    } 

で使用することができます

repositories { 
    maven { 
     url 'https://maven.google.com' 
    } 
} 

:また、あなたがルートgradle.buildで新しいレポを追加したことを確認してください

android { 
    .... 
    dataBinding { 
     enabled = true 
    } 
} 

これが最良の方法です。

buildscript { 
    repositories { 
     mavenCentral() 
     jcenter() 
     google() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:3.0.0' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     mavenCentral() 
     jcenter() 
     google() 
    } 
} 

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

とあなたのgradle-wrapper.propertiesファイル内に必ずある作るアプリレベルのbuild.gradleにも

distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip 

以下のようにラッパーのバージョンを変更するには、以下のルートレベルgradle.buildの使用では

以下のように26バージョンを使用

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.2" 
    defaultConfig { 
     applicationId "com.xxxx" 
     minSdkVersion 16 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 
関連する問題