可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I've been working on this app for almost a year now (senior project) when it just decided to break a few days ago. My application has been developed using Eclipse version 3.7.2 64bit targeting Froyo Android 2.2, using my Windows 7 64bit pc. So far I have tried:
- rearranging the uses-library tag in the manifest file
- rewriting the map xml file
- deleting the R.java file and refreshing
- placing the mapview element within a layout
- reinstalling eclipse and the android-sdk
- cleaning the project
- creating a style.xml file and referencing it
- deploying on a actual device
- reverting back to previous code
and possibly more...
My code is as follows: gmap.xml
AndroidManifest.xml
I highly appreciate any help in advance.
回答1:
You must include /path_to_android-sdk/extras/google/google_play_services/libproject/google-play-services_lib
Library as a external library into your project and also include this jar file /path_to_android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar
.
beside those, you should have these permissions:
****
回答2:
Try to add the above in your Manifest file.
回答3:
I think com.google.android.maps.MapView is now obsoleted now i used com.google.android.gms.maps.MapView. Please check http://developer.android.com/reference/com/google/android/gms/maps/MapView.html for help and If you want to use MapFragment then go through http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/ Url.
回答4:
I'd suggest to take a look at the Maps demo app. This comes bundle with the Google Play services lib, in your SDK manager just include the checkbox for Samples for Google Play Services. You then can find the project files @ /extras/google-play-services/samples/maps
in your SDK directory.
回答5:
these are the permissions you should have normally for a map v2
and the api key is now used in manifest file with meta tag