我試圖將谷歌admob集成在我的android工作室應用程序。我收到以下消息在我的日誌(我的格式道歉,將不勝感激的任何援助):谷歌播放服務不是最新的
05-30 01:23:47.389 19555-19555/com.example.livingstonlabs.whatsbest I/Ads: Starting ad request.
05-30 01:23:47.430 19555-25051/com.example.livingstonlabs.whatsbest W/GooglePlayServicesUtil: Google Play services out of date. Requires 9080000 but found 8489470
05-30 01:23:47.430 19555-25051/com.example.livingstonlabs.whatsbest W/Ads: Failed to connect to remote ad request service.
05-30 01:23:47.430 19555-25051/com.example.livingstonlabs.whatsbest W/Ads: Could not start the ad request service.
05-30 01:23:47.505 19555-19555/com.example.livingstonlabs.whatsbest W/GooglePlayServicesUtil: Google Play services out of date. Requires 9080000 but found 8489470
我假設我的谷歌播放服務是因爲某些原因過時,但我不明白爲什麼這很是。我會在最後申請插件:'com.google.gms.google-services'「。
的build.gradle(項目)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
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
}
apply plugin: 'com.android.application'
****的build.gradle(模塊:APP)****
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.livingstonlabs.whatsbest"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
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.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-database:9.0.0'
compile 'com.google.firebase:firebase-ads:9.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
我不明白這是怎麼可能的,因爲我在模擬器上運行它。 –
@JonahLivinston使用Genymotion模擬器,因爲你可以更新谷歌的播放服務 – Ronen