嗨當我建立我的android應用程序,我得到這個錯誤。我最近開始學習firebase和android。如果有人能幫忙,我會很感激。 我在這個錯誤上花了3個小時,仍然無法解決它。Firebase android錯誤 - java.util.zip.ZipException:重複項:com /谷歌/安卓/ gms/common/api/zzd.class
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/api/zzd.class
以下是應用程序級構建gradle文件。
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "app.com.date"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/notice'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license'
exclude 'META-INF/license.txt'
}
}
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.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebase:firebase-client-android:2.5.0'
compile 'com.android.support:design:25.0.1'
compile 'com.firebaseui:firebase-ui:0.4.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
代碼 - 我只是試圖從fireapp數據庫讀取數據到我的列表視圖。 package app.com.date;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import com.firebase.ui.database.FirebaseListAdapter;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
public class MainActivity extends AppCompatActivity {
private Button mSendData;
private ListView mListView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mListView = (ListView) findViewById(R.id.listview1);
DatabaseReference databaseReference = FirebaseDatabase.getInstance().getReferenceFromUrl("xxxxx");
FirebaseListAdapter<String> firebaseListAdapter = new FirebaseListAdapter<String>(
this, String.class, android.R.layout.simple_list_item_1,
databaseReference){
@Override
protected void populateView(View v, String model, int position) {
TextView textView = (TextView) v.findViewById(R.id.text1);
textView.setText(model);
}
};
mListView.setAdapter(firebaseListAdapter);
}
}
'火力點:火力點 - 客戶端Android版:2.5.0''是老火力地堡。你爲什麼擁有它? https://firebase.google.com/support/guides/firebase-android –
無論你「開始學習」的地方是使用過時的來源。閱讀實際的最新文檔 –
我是新來的學習Firebase。我試圖刪除客戶端的Android。 這是更新的文件列表,錯誤仍然存在compile'com.android.support:appcompat-v7:25.0.1'compile'com.google.firebase:firebase-database:10.0.1'compile'com.android .support:design:25.0.1'compile'com.firebaseui:firebase-ui:0.4.0'testCompile'junit:junit:4.12' 錯誤:任務執行失敗':app:transformClassesWithJarMergingForDebug'。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複條目:com/google/android/gms/internal/zzacw.class – user7327850