Google Maps V2存在问题

时间:2014-02-28 04:11:04

标签: android android-fragments android-maps-v2

我正在尝试使用地图创建应用程序,遵循Google在此video中演示的教程。问题是当我运行它时错误并关闭并且不会出现该错误。但调试代码我发现XML片段中的元素是问题,因为应用程序运行时撤退,但没有地图,当我放置时不打开。

我真的不知道该怎么做。

PS:我的代码与可以通过此link查看的教程相同。

1 个答案:

答案 0 :(得分:0)

在您的项目中,您将wrong library导入google-play-services_lib导入到same workspace作为library project项目所在的DemoGoogleMapsV2。然后添加{{1} } library project

DemoGoogleMapsV2的路径

<强> SDK ---&GT;额外---&GT;谷歌---&GT; google_play_services ---&GT; libproject -----&GT;谷歌播放服务-lib的


在manfest中

进行一些更改

google-play-services_lib

android:minSdkVersion="11"

应用程序代码中添加此元数据标记 您必须使用

指定使用哪个Google Play服务版本
android:minSdkVersion="12"

确保您使用<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 为{0}项目生成了自己的API-Key,否则ur_machine's_SHA-1_fingerprint;package name

了解更多信息GO Through This

https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2