Android:Google Play 服务无法在模拟器上运行

Android: Google play services not working on the emulator(Android:Google Play 服务无法在模拟器上运行)
本文介绍了Android:Google Play 服务无法在模拟器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须格式化我的 Windows 笔记本电脑,所以我复制了 SDK 文件夹(因为它大约 30 GB 大)并将它粘贴到新 Windows 副本上的相同位置.

I had to format my Windows laptop so I copied the SDK folder (because it's about 30 GB large) and i pasted it in the same place on the new Windows copy.

现在,当我启动 Android Studio 和 SDK Manager 时,一切看起来都很好,所有工具和软件包显示为已下载,但是当我启动模拟器来测试我的应用程序时,它显示 Get Google Play Services 我已经在我的 gradle 中,如下所示:

Now when I start Android Studio and SDK Manager everything looks fine and all tools & packages appear as downloaded, but when I start an emulator to test my app, it says Get Google Play Services which I already have in my gradle as follows:

编译'com.google.android.gms:play-services:7.0.0'

compile 'com.google.android.gms:play-services:7.0.0'

它在旧的 Windows 机器上运行良好,但现在它拒绝检测 Google Play 服务.

It was working fine on the old Windows machine but now it refuses to detect Google Play Services.

模拟器也很慢,以前在旧的 Windows 机器上很快.

Also the emulator is very slow, it used to be very fast on the old Windows machine.

我在这里缺少什么?

提前致谢.

推荐答案

emulator 上缺少 Google Play Services 应用程序.该库仅用于针对 Google Play 服务 API 编译项目.

The Google Play Services app is missing on the emulator. The library is required only to compile projects against the Google Play Services APIs'.

根据 设置 Google Play 服务:

如果您想在模拟器上测试您的应用,请展开目录Android 4.2.2 (API 17) 或更高版本,选择 Google API,以及安装它.然后创建一个以 Google API 为平台的新 AVD目标.

If you want to test your app on the emulator, expand the directory for Android 4.2.2 (API 17) or a higher version, select Google APIs, and install it. Then create a new AVD with Google APIs as the platform target.

所以您需要做的是使用 Google APIs 作为目标 SDK 设置.

So what you need to do is use the Google APIs as the target SDK setting.

这篇关于Android:Google Play 服务无法在模拟器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)