Android Studio不会在应用程序中显示地图
嗨,我有一个显示地图的应用程序。一切都很好,但我想用模拟器调试它,但在模拟器上我得到了这个错误 “您的设备上未安装Google play服务!” 好吧,我仔细研究了一下,我发现它必须与SDK做些什么,所以我确保安装并更新了“Extras”下所有必要的服务。但是仍然没有改变,我一直收到这个错误,模拟器上没有显示地图。好吧,然后我又挖了一些,人们说我必须修复我的gradel文件(我也在使用facebook SDK),所以我就是这么做的: 应用程序的渐变:Android Studio不会在应用程序中显示地图,android,facebook,google-maps,android-studio,google-play-services,Android,Facebook,Google Maps,Android Studio,Google Play Services,嗨,我有一个显示地图的应用程序。一切都很好,但我想用模拟器调试它,但在模拟器上我得到了这个错误 “您的设备上未安装Google play服务!” 好吧,我仔细研究了一下,我发现它必须与SDK做些什么,所以我确保安装并更新了“Extras”下所有必要的服务。但是仍然没有改变,我一直收到这个错误,模拟器上没有显示地图。好吧,然后我又挖了一些,人们说我必须修复我的gradel文件(我也在使用facebook SDK),所以我就是这么做的: 应用程序的渐变: dependencies { compile
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'
}
这是我在日志中得到的错误信息:
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创建一个新的虚拟设备,当向导要求您选择一个系统映像时,请确保您选择的映像在目标列上显示Google API(Google Inc.) 然后,在启动应用程序时,请确保选择刚刚创建的仿真器映像
Google Play服务和Google地图仅在Google认可的设备上可用,默认情况下在普通模拟器图像上不可用。哦,我的天。。。这么简单的错误…:D谢谢你!!