【问题标题】:Update Google Play Service error更新 Google Play 服务错误
【发布时间】:2018-02-14 13:03:13
【问题描述】:

运行我正在使用 Firebase 身份验证工具的应用程序时遇到问题。

当我进入流程的“创建帐户”阶段时,我遇到了“错误”,告诉我更新我的 Google Play 服务。

我已尝试通过 project structure > dependencies 手动添加 Google Play 服务,但无济于事 - 问题依旧。

模块:app Gradle 文件

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.example.XXX.myapplication"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.0.2'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.android.support:recyclerview-v7:27.0.2'
    compile 'com.android.support:cardview-v7:27.0.2'
    compile 'com.android.volley:volley:1.1.0'
    implementation 'com.github.bumptech.glide:glide:4.6.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
    compile 'com.google.firebase:firebase-core:11.8.0'
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.android.support:mediarouter-v7:27.0.2'
    implementation 'com.google.android.gms:play-services-ads:11.8.0'
}

apply plugin: 'com.google.gms.google-services'

已检查 Stack 中的其他线程,但似乎没有一个可以解决问题。对此的任何帮助将不胜感激!谢谢。

【问题讨论】:

    标签: android android-studio firebase firebase-authentication


    【解决方案1】:

    此通知报告必须更新手机上安装的 Google 支持库的版本以支持您尝试运行的应用程序。通常这个支持库会在新版本发布时自动更新。

    您需要从 Google Play 商店下载更新。如果您点击通知,它应该会在 Google Play 服务上打开 Play Store 应用。然后点击更新。

    【讨论】:

    • 这将不允许我使用模拟器执行此操作。一旦我点击消息,它就会消失。
    • 更新:我在下面添加了您的答案。感谢您朝正确的方向点头。
    【解决方案2】:

    一旦我使用 file structure > dependencies 添加了 Google Play 服务库,这里所需要的就是创建一个新的 AVD。 Google Play 服务似乎不会向已存在的 AVD 注册。

    然后我不得不更新 Google Play。这是通过单击控制面板底部的... 来完成的,导航到 Google Play 选项卡。然后点击更新:

    希望这会有所帮助。

    【讨论】:

    【解决方案3】:

    试试这个,如果播放服务没有更新,它会重定向你更新它:

    public boolean checkPlayServices() {
        GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance();
        int resultCode = apiAvailability.isGooglePlayServicesAvailable(this);
        if (resultCode != ConnectionResult.SUCCESS) {
            if (apiAvailability.isUserResolvableError(resultCode)) {
                apiAvailability.getErrorDialog(this, resultCode,9000).show();
            } else {
                Log.i("error", "This device is not supported.");
                finish();
            }
            return false;
        }
        return true;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-12
      相关资源
      最近更新 更多