2017-07-22 21 views
0

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/ads/identifier/AdvertisingIdClient.classエラー:タスク ':app:transformClassesWithJarMergingForDebug'の実行に失敗しました

これは私のbuild.gradleファイルです。私はそれを解決することができませんでした。

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.example.raja.myproject" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
      multiDexEnabled true 

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


dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 

    testCompile 'junit:junit:4.12' 


compile 'com.android.support:appcompat-v7:23.4.0' 

compile 'com.google.android.gms:play-services-analytics:7.3.0' 



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



    compile 'com.google.android.gms:play-services-location:9.8.0' 



    compile 'com.android.support:multidex:1.0.0' 



compile 'com.google.android.gms:play-services-appindexing:9.8.0' 

} 

答えて

0

私の知る限りでは、すべてのGoogleは、同じバージョンを使用する必要がありますサービスを再生 - あなたの依存関係のセクションでは、あなたは(いくつかは、いくつかは9.8.0で、7.3.0である)ではありません見ることができます。それらがすべて同じバージョンを使用するように変更し、もう一度やり直してください。

+0

私は変更してありがとう、ありがとう。しかし、今私はこのエラーが発生しましたエラー:タスク ':app:transformClassesWithJarMergingForDebug'の実行に失敗しました。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複エントリ:com/google/android/gms/internal/zzanq.class –

+0

次の行を削除してください:compile 'com.android .support:appcompat-v7:23.4.0 'そして何が起こるかを見てください – yakobom

+0

私は同じエラーを試みました:( –

0

次のようにマニフェストファイルにあなたのApplicationタグにtools:node="merge"を配置しようとすると:

<application 
     android:name=".MyApplication" 
     android:allowBackup="false" 
     android:icon="@drawable/icon144x" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     tools:node="merge" 
     android:theme="@style/AppTheme"> 

</application> 

は、それが問題を解決することを願っています。

関連する問題