How to download Google Play Services in an Android emulator?

后端 未结 12 1115
借酒劲吻你
借酒劲吻你 2020-11-22 15:26

I want to use Google Play Services API in my application, but when I open the emulator to test my application it sends me a message that says \"Google Play Services must be

12条回答
  •  有刺的猬
    2020-11-22 16:07

    For api 21+ you can use system image with Google Play as I describe below.

    For api 19+ (Android 4.4 Kitkat) you can use system image x86 with Google Api (I was able to use it).

    For api 17+ (Android 4.2.2) you can TRY to use system image ARM with Google Api (It didn't work for me).

    I was able to install Google Play and Google Services as separate apks to pure system image api 16 and 17, but they don't really work after that (services crush and play not opens). So seems like it is not possible to make them work on pure AVD image because they should be installed with root access. The same for updating Google Services on AVD system image with Google API preinstalled - can't update because of incompatible certificates, can't uninstall even using adb because don't have access.


    How to setup AVD system image with Google Play

    Now even better solution exist: using AVD image with build-in Google Play Services. It will enable you to use Google Services including Google Play. Also you will be able update it without re-creating AVD image.

    Open AVD manager and choose create new device. You should use device definition with play store icon.

    Then choose system image for it. You should choose one with Google Play and NOT with Google API.

    Then launch new device.

    You can update Play Services as shown on screenshot, or manually on device..

提交回复
热议问题