0
我試圖將Firebase添加到我的項目中,但我被卡住了。這裏是我的構建gradle這個項目:在創建Firebase時生成Gradle時出錯
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
,這裏是我的構建gradle這個模塊的應用程序:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.vlad.comentariibac"
minSdkVersion 9
targetSdkVersion 24
versionCode 5
versionName "1.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0-alpha1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.firebase:firebase-core:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
線 compile 'com.google.android.gms:play-services-ads:9.0.0'
的亮點是紅色的,並說所有google.android.gms
庫必須使用準確相同的版本規格。我需要一些幫助。提前致謝!
我相信這個錯誤是不言自明的。您必須爲admob使用相同的版本號:編譯''com.google.android.gms:play-services-ads:10.0.1'' –