【问题标题】:Google Play services out of date. Requires 9877000 but found 9875470Google Play 服务已过时。需要 9877000 但找到 9875470
【发布时间】:2016-11-12 21:08:15
【问题描述】:

这是我的 gradle.app

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"

    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
    }

    defaultConfig {
        applicationId "com.example.joshpc.bluetoothattendee"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    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.0'
    compile 'com.google.android.gms:play-services-gcm:9.8.0'
    compile 'com.google.gms:google-services:3.0.0'
    compile 'com.google.firebase:firebase-auth:9.8.0'
    compile 'com.google.firebase:firebase-core:9.8.0'
    compile 'com.firebase:firebase-client-android:2.5.2'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

当我尝试运行我的 android 模拟器时,它给了我这个读数:

W/GooglePlayServicesUtil: Google Play services out of date.  Requires 9877000 but found 9875480

我已尝试将 firebase 和 google play 服务恢复到 9.6.0,但由于 firebase 需要 9.8.0,所以这不起作用

我在独立 SDK 管理器中更新了我的 API 25 android 系统映像。

我的 google play 存储库是最新的。

如果我将我的 gradle 更改为调用 play services 9.8.7,它会给我错误:

如果我将 GPS 降级到 9.6.0,我会得到:

W/DynamiteModule: Local module descriptor class for com.google.firebase.auth not found.

所以当 SDK 说它是最新的并且我无法恢复所需的版本时,我不太确定如何解决这个问题或更新播放服务。 请注意,“安装存储库和同步”不可点击/不链接到任何东西。我检查了存储库版本及其最新

我在模拟器中检查了版本,它运行的是 9.8.75

【问题讨论】:

  • compile 'com.google.gms:google-services:3.0.0' 不应该在那里
  • 删除了它。还在扔Google Play services out of date. Requires 9877000 but found 9875470
  • 'com.firebase:firebase-client-android:2.5.2' 是旧的 Firebase。你在哪里看到添加的?
  • 老实说,youtube。将其更新为 compile 'com.google.firebase:firebase-database:9.8.0' 仍然抛出错误
  • 嗯,首先,9.8.0 is the latest,所以我不知道你为什么尝试9.8.7

标签: android gradle firebase google-play-services


【解决方案1】:

如果您想在配置了包含 Google API 版本 9875480 的系统映像的模拟器上运行,您唯一的选择是降级 Google Play Service 和 Firebase API 的版本:

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    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.0'
    compile 'com.google.android.gms:play-services-gcm:9.6.1'
    //compile 'com.google.gms:google-services:3.0.0'
    compile 'com.google.firebase:firebase-auth:9.6.1'
    compile 'com.google.firebase:firebase-core:9.6.1'
    //compile 'com.firebase:firebase-client-android:2.5.2'
    testCompile 'junit:junit:4.12'
}

虽然你说你这样做了,但仍然收到同样的警告,但我对此表示怀疑。我能够使用这些依赖项进行构建,并在 Google API 版本 9875480 的模拟器上运行。

如果您想使用 9.8.0 版本进行构建,我认为您需要在真实设备上运行。我认为没有发布任何支持 9.8.0 的模拟器图像,至少不支持 API 25。

【讨论】:

  • 这确实给我谷歌播放服务错误,而是给我Local module descriptor class for com.google.firebase.auth not found.
  • 该警告可以忽略。它是无害的。
  • 那么这意味着我的代码由于其他原因无法正常工作?
  • 虽然我不知道你的代码中有什么不起作用,但我几乎可以肯定警告不是问题。我已经使用它几个月了,并且能够授权用户、读/写数据以及执行许多其他 Firebase 操作。
  • 好吧,我会更多地研究这个问题。谢谢你的信息!
【解决方案2】:

只需更改此行:compile 'com.google.android.gms:play-services-gcm:9.8.0' 到:

compile 'com.google.android.gms:play-services-gcm:9.6.0'

每件事都应该运作良好

对于火力基地试试这个: compile 'com.google.firebase:firebase-auth:9.6.1' compile 'com.google.firebase:firebase-core:9.6.1'

【讨论】:

  • 为什么建议降级?
猜你喜欢
  • 1970-01-01
  • 2013-07-25
  • 2013-02-15
  • 2019-09-23
  • 2015-08-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多