Android Studio 不会在应用程序中显示地图

Android Studio would not show map in app

您好,我有一个显示地图的应用程序。一切都很好,但我想使用模拟器对其进行调试,但在模拟器上出现此错误。

"Google play services not installed on your device!"

好的,我仔细研究了一下,发现它必须对 SDK 做一些事情,所以我确保安装并更新了 "Extras" 下的所有必要服务。但仍然没有变化我不断收到此错误并且模拟器上没有显示地图。好的,然后我再挖掘一些,人们说我必须修复我的 gradel 文件(我也在使用 facebook SDK)所以这就是我所做的:

gradle 应用:

dependencies {
compile 'com.googlecode.android-query:android-query:0.25.9'
compile 'com.google.maps.android:android-maps-utils:0.3+'
compile 'com.github.nirhart:parallaxscroll:1.0'
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/chart.jar')
compile project(':facebook')
/*Adding app Compat to compatibilize Lollipop widgets*/
compile 'com.android.support:appcompat-v7:21.0.+'
/*Card view (the cute one on lollipop)*/
compile 'com.android.support:cardview-v7:21.0.+'
/*recycler view, la posta de la optimizacion*/
compile 'com.android.support:recyclerview-v7:21.0.+'
compile('com.crashlytics.sdk.android:crashlytics:2.2.0@aar') {
    transitive = true;
}
compile('com.twitter.sdk.android:twitter:1.1.1@aar') {
    transitive = true;
}
compile 'com.android.support:support-v13:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
}

这是 facebook SDK 的 gradle 文件:

dependencies {
compile 'com.android.support:support-v4:20.0.+'
compile 'com.parse.bolts:bolts-android:1.1.2'
compile 'com.google.maps.android:android-maps-utils:0.3.4'
compile 'com.google.maps:google-maps-services:0.1.5'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:support-v13:21.0.3'
}

这是我在 logcat:

中收到的错误消息
01-29 17:56:15.860    2375-2375/com.myapp.user W/GooglePlayServicesUtil﹕ Google Play services is missing.
01-29 17:56:15.880    2375-2375/com.myapp.user W/GooglePlayServicesUtil﹕ Google Play services is missing.
01-29 17:56:15.880    2375-2375/com.myapp.user W/GooglePlayServicesUtil﹕ Google Play services is missing.
01-29 17:56:15.890    2375-2375/com.myapp.user W/GooglePlayServicesUtil﹕ Google Play services is missing.
01-29 17:56:15.940    2375-2410/com.myapp.user W/EGL_emulation﹕ eglSurfaceAttrib not implemented
01-29 17:56:15.940    2375-2410/com.myapp.user W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0x7f4811e9a840, error=EGL_SUCCESS

从 Android Studio 创建一个新的虚拟设备,当向导要求您 select 一个系统映像时,请确保您 select 一个显示 Google 目标列上的 API(Google Inc)。

然后当您启动您的应用程序时,请确保您 select 您刚刚创建的模拟器图像。

Google Play 服务和 Google 地图仅在 Google 批准的设备上可用,默认情况下在普通模拟器图像上不可用。