Android: Google play services not working on the emulator

筅森魡賤 提交于 2019-11-28 05:39:49

问题


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.

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:

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

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

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

What am i missing here ?

Thanks in advance.


回答1:


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

As per the reference documentation at Setting Up Google Play Services:

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.

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




回答2:


Download Google Play Services 7.0 and install it in your emulator either via adb shell or simply by dragging and dropping.

I recommend GenyMotion emulators as they are comparatively fast and easy to access.



来源:https://stackoverflow.com/questions/29429727/android-google-play-services-not-working-on-the-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!