我正在尝试将google 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(模块:应用)****
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'
答案 0 :(得分:0)
这意味着手机的Google Play安装速度低于您在清单中指定的版本。
您需要更新手机的Google Play服务。
答案 1 :(得分:0)
您需要更新Google Play服务应用程序。您可以使用GoogleApiAvailability
获取Intent
以启动恢复过程。 [0]
用于验证Google Play服务APK在设备上是否可用并且是最新的。
您可能希望在运行时检查GooglePlayServices是否在设备上是最新的。如果没有,只需显示相应的errorDialog,它将提示用户更新它。
GoogleApiAvailability
查看文档以获取更多信息:https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project
答案 2 :(得分:0)