2017-01-10 48 views
2

私はFirebaseを使ったチャットアプリを作成しようとしていますが、私は、コードを実行すると、私はこのエラーを取得する:Androidのエラー:実行タスクに失敗しました「:アプリ:transformClassesWithJarMergingForDebug

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. 
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/auth/api/signin/internal/zzf.class 

マイグレードファイル:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "24.0.2" 
defaultConfig { 
    applicationId "com.example.sebastian.chatapp" 
    minSdkVersion 16 
    targetSdkVersion 25 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    multiDexEnabled true 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
} 

} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
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.1.0' 
compile 'com.android.support:design:25.1.0' 
compile 'com.google.firebase:firebase-core:9.8.0' 
compile 'com.google.firebase:firebase-invites:9.8.0' 
compile 'com.firebaseui:firebase-ui:0.6.0' 
compile 'com.google.firebase:firebase-auth:10.0.0' 
compile 'com.android.support:support-v4:25.1.0' 
testCompile 'junit:junit:4.12' 


} 



apply plugin: 'com.google.gms.google-services' 

どうすればこの問題を解決できますか?

+0

はこれを試してみてください - >のhttp:/ /stackoverflow.com/a/41022120/4018207 – AndiGeeky

+0

libbaseにfirebase jarファイルを置いたのですか? –

+0

@YounasBangash Firebase Assistantを使用してfirebaseを追加しました –

答えて

0

私は同じ問題がありました!これはノンセンスタイプの問題&解決策です。

apply plugin: 'com.google.gms.google-services'をファイルの先頭に移動します。

apply plugin: 'com.android.application' 
apply plugin: 'com.google.gms.google-services' 

...... 
+0

いいえ...スチルの成功 –

0

Heyコードには重複する依存関係が含まれています。

compile'com.android.support:appcompat-v7:25.1.0' 
compile'com.google.firebase:firebase-core:10.0.1' 
compile'com.android.support:design:23.4.0' 
compile'com.google.firebase:firebase-core:9.8.0' 
compile'com.google.firebase:firebase-invites:9.8.0' 
compile'com.firebaseui:firebase-ui:0.6.0' 
compile'com.google.firebase:firebase-auth:10.0.0' 
compile'com.android.support:appcompat-v7:25.1.0' //remove this 
compile'com.android.support:design:25.1.0' //remove this 
compile'com.android.support:support-v4:23.0.1' //remove this 
testCompile'junit:junit:4.12' 

このヘルプが必要です。ハッピーコーディング。

+0

まだ同じ問題... –

+0

更新を確認してください –

+0

いいえ...まだ同じ発行 –

0

Firebase UIは、Firebase SDKライブラリに推移的に依存します。互換性のあるバージョンはFirebase UI documentationの表にリストされています。 Firebase SDKの最新バージョン(10.0.1)を使用するには、Firebase UIライブラリのバージョン1.0.1を使用する必要があります。 Firebase SDKライブラリとサポートライブラリの一貫したバージョンも使用する必要があります。このようなあなたの依存関係を更新します。また

compile 'com.android.support:appcompat-v7:25.1.0' 
compile 'com.android.support:design:25.1.0' 
compile 'com.android.support:support-v4:25.1.0' 
compile 'com.google.firebase:firebase-core:10.0.1' 
compile 'com.google.firebase:firebase-invites:10.0.1' 
compile 'com.google.firebase:firebase-auth:10.0.1' 
compile 'com.firebaseui:firebase-ui:1.0.1' 
testCompile 'junit:junit:4.12' 

を、firebase-ui:1.0.1次の変更を使用するプロジェクトに行われなければならない(トップレベル)build.gradleファイル:

allprojects { 
    repositories { 
     jcenter() 
     mavenLocal() 
     mavenCentral() 
     maven { url 'https://maven.fabric.io/public' } 
    } 
} 
+0

エラー:解決に失敗しました:com.twitter。 sdk.android:twitter:2.2.0 –

+0

プロジェクトbuild.gradleのリポジトリリストを変更しましたか? –

+0

はい............. –

関連する問題