加入AdMob這是我的文件gradle這個代碼錯誤出現,而在Android Studio中
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.example.administrator.shawarma"
minSdkVersion 15
targetSdkVersion 24
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:24.2.1'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
testCompile 'junit:junit:4.12'}apply plugin: 'com.google.gms.google-services'
它顯示像跑步
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzqb.class
我認爲他們可能是與新庫問題,請嘗試使用該'編譯「com.google.firebase:火力核心:10.0.1'' –
對不起嘗試更換這個'編譯」 com.google.android.gms :play-services:10.0.1'並刪除這個'compile'com.google.firebase:firebase-ads:10.0.1'' –