Android 应用程序显示 Google Play 服务已过期

Android app is saying Google Play services out of date

提问人:Programmer 提问时间:11/6/2023 更新时间:11/6/2023 访问量:59

问:

我正在尝试在我的 Android (Java) 项目中创建一个基本的 Google 地图,但每次我尝试运行它时,我都会转到日志语句,它说

"Google Play services out of date for com.example.findaseat.  Requires 13400000 but found 11743470"

只是关于正在运行的内容的一些信息:

  1. 安卓工作室 长颈鹿 |2022.3.1 补丁 1 Build #AI-223.8836.35.2231.10671973,构建于 2023 年 8 月 16 日

  2. Pixel 2 Nougat API 级别:24 ABI:x86 目标:Android 7.0(Google Play 服务)

当我尝试运行程序时,我的模拟器上显示了这一点

  1. 这些是我的 SDK 工具

SDK 工具

  1. 谷歌地图相关代码:
dependencies {

    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("com.google.android.material:material:1.9.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
    implementation("com.google.firebase:firebase-auth:22.2.0")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
    implementation ("com.google.android.gms:play-services-maps:18.1.0")

}

Android清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <application
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.FindASeat"
        tools:targetApi="31">

        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/my_map_api_key" />

    </application>

</manifest>

我按照此视频中的所有步骤完成了其余代码: 谷歌地图设置

我尝试单击模拟器上的更新按钮,它要求我登录我的Google帐户,我这样做了,但每次它都会给我一个服务器错误。

服务器错误

我尝试转到我的模拟器设置,但在播放服务更新时出现加载屏幕。

模拟器设置

我也尝试使用其他模拟器(Nexus等),但我一直遇到同样的问题。我也不确定在我的构建文件中将我的谷歌地图 API 版本降级到哪个版本,我已经尝试了一堆数字,如果我太低,有时我会在我的 MainActivity.java 中出现错误

java android google-maps mobile

评论

0赞 Robert 11/6/2023
“Google Play 服务”是您必须更新的手机上的系统应用程序。通常,这是通过Play商店自动发生的,但您也可以手动更新它。support.google.com/googleplay/answer/9037938?hl=en
0赞 Programmer 11/6/2023
我正在 Android Studio 上创建一个程序,所以它不在我的手机上,但我尝试从模拟器手动更新它,但它不起作用
0赞 Robert 11/6/2023
Android Studio 不执行 Andrid 应用。要运行应用程序,您需要一部手机 - 它可以是物理手机或虚拟手机(模拟器),但您需要一部手机。
0赞 Programmer 11/6/2023
当然,我尝试使用链接手动更新它,但这仍然没有解决我的问题。
0赞 Yrll 11/10/2023
可能是您使用的设备仍在牛轧糖上。或者,因为您运行的模拟器没有 Google Play 服务。请确保您运行的模拟器带有一个模拟器。

答: 暂无答案