Google map android API V2 crashed

让人想犯罪 __ 提交于 2019-11-28 10:22:10

I also faces this kind of the problem,when first time coding for the map with API V2.

Just try using the extends with FragmentActivity instead of the Activity

you have to copy the project(goolge_play_services) into your workspace and then attach it to your project. In above image it show the cross red,so select it and remove and then after once again add attach the library with the project.

It is required to use SupportMapFragment if API version is below 11

<fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment"/>
  • Important

    Don't forget to extend your Activity with FragmentActivity

you have to copy the project(goolge_play_services) into your workspace and then attach it to your project.

What you are doing is importing the project and not checkmarking the copy the project into workspace due to which it showing you wrong mark in added libraries.

So just checkmark the the copy the project into workspace while importing the google_play_services project and then attach it to your project.

As here i can see that you are using the api level 8 and AFAIK the "Fragments" are supported from the 11.

So here you need to use the compatible library of the fragments.

And also make sure that you have also imported the library of the google-play-service in your workspace and added it in your application.

You need to edit your application's AndroidManifest.xml file, and add the following declaration within the element. This embeds the version of Google Play services that the app was compiled with.

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!