简体   繁体   中英

Google Maps fragment activity

I am really sorry to ask such a bland and stupid question, but I am having the greatest of frustrations with trying to load the Google Maps project library into my project resources.

I have downloaded all the tools and necessities needed from the SDK to get Google Maps.

However, whenever I try to load the Google Maps library, I get 2 errors.

The first is that for some reason,

the Class known as FragmentActivity is missing. I have no idea what it is or where to find it to get things going with an Android project.

The second distinct problem is that the console shoots off the following message:

"google_maps] Unable to resolve target 'android-16'"

Although I have a fairly strong idea of what this means, I don't quite know how to troubleshoot so that the library is built towards the desired API level.

I do apologize as I am new to Android and absolutely love the platform, but this one really has me dumbfounded. Any and all information and suggestions is always most appreciated.

Thanks and once again, sorry for asking something so silly.

Well for the first question:

FragmentActivity is part of the google-support-v4 library and designed for application that are developed to SDK < 11 for supporting fragments. So you didn't added the referencing of this library to you project.

you can get a better idea of the imports you need to make and how to make them by reading this blog post I wrote on Google Map API V2:

Google Map API V2 guide

about your second question, you probably trying to run this project against an API level you didn't downloaded from the SDK Manager , you have two options:

  1. downloaded the needed API package from the SDK Manager .

  2. right click on your project -> Properties -> Android -> change the project build target to a target that you have its API level downloaded.

Try this answer, Generate Google Map key for android - step by step .

Or take a look to this very helpful step by step tutorial . I struggle for 3 days with the maps stuff, but that tutorial showed me the light.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM