首页 > 解决方案 > Android: Is it possible to use Google Maps API on emulator?

问题描述

I'm trying to use Google Maps API on emulator but I'm struggling with it. I already set up the API key (I set the package name and SHA-1 on Google console as well) but this error happens.

Here is AndroidManifest.xml:

<meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="" />
<meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

Google Maps Android API: Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above

Seems like Nexus 5 cannot be used for the Google Maps API on emulator because Emulated Performance is needed to specify to use the Google Maps API.

So I tried to use Nexus 4 instead because I can specify Emulated Performance: Graphics for the device but this error happens on the display.

This App won't run until you update Google Play Services.

I looked up this error and all the answers to this error are kind of old so I cannot understand how I can configure it correctly.

How can I fix these errors? Has anyone beeen successful in using the API on emulator recently?

标签: javaandroidgoogle-mapsgoogle-maps-android-api-2

解决方案


创建虚拟设备时,仅选择具有播放商店的设备,否则播放服务将不可用。最新的是 Pixel 2,所以我建议使用它

在此处输入图像描述


推荐阅读