Android Studio 模拟器 "won't run unless you update Google Play Services"
AndroidStudio emulator "won't run unless you update Google Play Services"
我的模拟器有这个问题,我正在使用 API 5.1.1 并且我有来自 SDK Manager 的最新版本 Google Play Services。
AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
在build.grable中:
compile 'com.google.android.gms:play-services:+'
您的 build.gradle 有这一行:
compile 'com.google.android.gms:play-services:+'
这意味着 android 将在应用 运行 时使用最新版本的 Google Play 服务。模拟器可能没有所有最新更新,因此应用程序不会 运行。更新 Google Play 服务会有帮助。
导航到模拟器中的设置--> 应用程序,然后找到 Google Play 服务,检查版本号并在你的 build.gradle
中使用它
希望对您有所帮助
我将 SDK 从 5.1 降级到 5.0,它正在运行。
将模拟器中的 SDK 更改为 v21 或更低版本。物理设备不受此问题影响。
Android 抱怨 Google Play 服务更新的原因与 Android v22 及更高版本的 Android 模拟器中的一个已知问题有关(在此时间 23)。 https://code.google.com/p/android/issues/detail?id=176348
您应该尝试在构建脚本中使用最新版本的 Play 服务,因为用户通常被迫在他们的设备上安装最新版本的 Play 服务。
在 Android Studio 2.2 上遇到了同样的问题。我所做的是转到 SDK Manger
-> Launch Standalone SDK Manager
,卸载 Broken Intel x86 Atom google_apis
。重新启动 Android Studio 和 运行 项目,弹出窗口询问 Download System Image
,点击 OK
继续,然后问题消失了。
当我在模拟器 Android 5.1.1 (x86_64) - API 22 上启动我的应用程序时出现了这个问题。我已经阅读了一些关于它的讨论,但是没有人从他们帮助了我。
我试图在 gradle 构建脚本中调整 Google Play Services 的版本(我的意思是您应该使用 "app" 名称更新脚本)。当您更新脚本中的某些内容时,不要忘记同步 gradle。
我的 gradle 脚本 "app" 更新后:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.itmm.map"
minSdkVersion 16
targetSdkVersion 24
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(dir: 'libs', include: ['*.jar'])
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:24.2.1'
compile 'com.google.android.gms:play-services:9.0.0'
testCompile 'junit:junit:4.12'
}
请查看依赖项部分。您对以下脚本行感兴趣:
compile 'com.google.android.gms:play-services:9.0.0'
目前,版本。 9.0.0 帮助我,一切正常。我可以在 Android 模拟器上看到 MapActivity。 9.0.0 不是 Google Play Services 的最新版本(最新版本是 9.6.1),但它可以工作并且可以解决您的问题,如果您对版本的新功能不感兴趣的话。 9.6.1.
在模拟器上使用 google 帐户登录后,我的问题已解决。 'update' 按钮在那之后起作用
如果您安装了 google 播放服务,请检查您的 SDK 设置:
Android Studio--系统设置--Android SDK--SDK工具:
查找:Google Play Services 和 Google Play Licensing Library 并确保他们的状态是:已安装.....如果上面的清单是完美的,下一步你应该执行的是:
打开您的 build.gradle 项目级别 gradle 并检查您的 gradle 是否具有:
classpath 'com.google.gms:google-services:3.1.0'
然后在您的应用级别gradle:
在 dependencies 下:
dependencies{
implementation 'com.google.android.gms:play-services-auth:11.8.0'
and at the end of your gradle file:
repositories {
mavenCentral()
apply plugin: 'com.google.gms.google-services'
}
下一个
单击您在模拟器通知栏中不断收到的通知错误,然后使用您的 google 帐户(现有电子邮件地址和密码)登录
然后再次尝试 运行 应用程序...如果仍然出现错误,请单击通知错误并尝试登录,继续尝试,直到最终 google playstore 应用程序将安装并提示您更新它。
这是最简单的过程,它需要一点耐心,但最终它会起作用。
祝你好运
I had the same issue. But I followed the following things
1) First download the latest build tools and play services in Android SDK
Android Studio -> Tools -> Android -> SDK Manager -> SDK Tools -> Android SDK Build Tools -> Install them
& install Play Services by following same steps
2) Create a new emaulator with latest api level for ex( API level : 28)
3) Run the app in the latest emulator
It will work fine.
我的模拟器 Google Play 服务版本是 12.6.85
所以我将 build.gradle 更改为:
implementation 'com.google.android.gms:play-services-maps:12.0.1'
备注:
- 检查模拟器的 Google Play 服务版本:转到 Emulator\Settings\Apps\GooglePlay services
- 要查看 build.gradle 的可用版本,请检查 https://developers.google.com/android/guides/releases
因为我在 2020 年还没有看到任何可行的解决方案。有两种方法可以解决这个问题:
简单的方法是使用 PlayStore Enabled
创建一个新的模拟器。在为模拟器下载系统映像之前检查。
困难的方法是在模拟器上手动安装 Google Play Store
并使更新按钮起作用。安装部分可以参考here。
之后,应用程序将在几分钟内自动更新 Google Play 服务。就这些了。
注意:如果这不起作用,请转到 Chrome -> 搜索 Google Play 服务并打开 playStore link 并在那里更新它。
我的模拟器有这个问题,我正在使用 API 5.1.1 并且我有来自 SDK Manager 的最新版本 Google Play Services。
AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
在build.grable中:
compile 'com.google.android.gms:play-services:+'
您的 build.gradle 有这一行:
compile 'com.google.android.gms:play-services:+'
这意味着 android 将在应用 运行 时使用最新版本的 Google Play 服务。模拟器可能没有所有最新更新,因此应用程序不会 运行。更新 Google Play 服务会有帮助。
导航到模拟器中的设置--> 应用程序,然后找到 Google Play 服务,检查版本号并在你的 build.gradle
中使用它希望对您有所帮助
我将 SDK 从 5.1 降级到 5.0,它正在运行。
将模拟器中的 SDK 更改为 v21 或更低版本。物理设备不受此问题影响。
Android 抱怨 Google Play 服务更新的原因与 Android v22 及更高版本的 Android 模拟器中的一个已知问题有关(在此时间 23)。 https://code.google.com/p/android/issues/detail?id=176348
您应该尝试在构建脚本中使用最新版本的 Play 服务,因为用户通常被迫在他们的设备上安装最新版本的 Play 服务。
在 Android Studio 2.2 上遇到了同样的问题。我所做的是转到 SDK Manger
-> Launch Standalone SDK Manager
,卸载 Broken Intel x86 Atom google_apis
。重新启动 Android Studio 和 运行 项目,弹出窗口询问 Download System Image
,点击 OK
继续,然后问题消失了。
当我在模拟器 Android 5.1.1 (x86_64) - API 22 上启动我的应用程序时出现了这个问题。我已经阅读了一些关于它的讨论,但是没有人从他们帮助了我。
我试图在 gradle 构建脚本中调整 Google Play Services 的版本(我的意思是您应该使用 "app" 名称更新脚本)。当您更新脚本中的某些内容时,不要忘记同步 gradle。
我的 gradle 脚本 "app" 更新后:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.itmm.map"
minSdkVersion 16
targetSdkVersion 24
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(dir: 'libs', include: ['*.jar'])
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:24.2.1'
compile 'com.google.android.gms:play-services:9.0.0'
testCompile 'junit:junit:4.12'
}
请查看依赖项部分。您对以下脚本行感兴趣:
compile 'com.google.android.gms:play-services:9.0.0'
目前,版本。 9.0.0 帮助我,一切正常。我可以在 Android 模拟器上看到 MapActivity。 9.0.0 不是 Google Play Services 的最新版本(最新版本是 9.6.1),但它可以工作并且可以解决您的问题,如果您对版本的新功能不感兴趣的话。 9.6.1.
在模拟器上使用 google 帐户登录后,我的问题已解决。 'update' 按钮在那之后起作用
如果您安装了 google 播放服务,请检查您的 SDK 设置: Android Studio--系统设置--Android SDK--SDK工具:
查找:Google Play Services 和 Google Play Licensing Library 并确保他们的状态是:已安装.....如果上面的清单是完美的,下一步你应该执行的是:
打开您的 build.gradle 项目级别 gradle 并检查您的 gradle 是否具有:
classpath 'com.google.gms:google-services:3.1.0'
然后在您的应用级别gradle: 在 dependencies 下:
dependencies{
implementation 'com.google.android.gms:play-services-auth:11.8.0'
and at the end of your gradle file:
repositories {
mavenCentral()
apply plugin: 'com.google.gms.google-services'
}
下一个
单击您在模拟器通知栏中不断收到的通知错误,然后使用您的 google 帐户(现有电子邮件地址和密码)登录 然后再次尝试 运行 应用程序...如果仍然出现错误,请单击通知错误并尝试登录,继续尝试,直到最终 google playstore 应用程序将安装并提示您更新它。 这是最简单的过程,它需要一点耐心,但最终它会起作用。 祝你好运
I had the same issue. But I followed the following things
1) First download the latest build tools and play services in Android SDK
Android Studio -> Tools -> Android -> SDK Manager -> SDK Tools -> Android SDK Build Tools -> Install them
& install Play Services by following same steps
2) Create a new emaulator with latest api level for ex( API level : 28)
3) Run the app in the latest emulator
It will work fine.
我的模拟器 Google Play 服务版本是 12.6.85
所以我将 build.gradle 更改为:
implementation 'com.google.android.gms:play-services-maps:12.0.1'
备注:
- 检查模拟器的 Google Play 服务版本:转到 Emulator\Settings\Apps\GooglePlay services
- 要查看 build.gradle 的可用版本,请检查 https://developers.google.com/android/guides/releases
因为我在 2020 年还没有看到任何可行的解决方案。有两种方法可以解决这个问题:
简单的方法是使用
PlayStore Enabled
创建一个新的模拟器。在为模拟器下载系统映像之前检查。困难的方法是在模拟器上手动安装
Google Play Store
并使更新按钮起作用。安装部分可以参考here。
之后,应用程序将在几分钟内自动更新 Google Play 服务。就这些了。
注意:如果这不起作用,请转到 Chrome -> 搜索 Google Play 服务并打开 playStore link 并在那里更新它。