MapActivity cannot be resolved to a type

时间秒杀一切 提交于 2019-12-10 02:41:59

问题


I'm busy trying to get the MapView included in my Android project. I'm following the MapView tutorial on the Android developer website but I'm getting an error:

'MapActivity cannot be resolved to a type'

I tried pressing Ctrl+Shift+O to auto import all classes but it's not helping. When I try to include the Maps libary manually it gives this error:

'The import com.google.android cannot be resolved'

I have added the following line (see below) to the Manifest and my target is API 7 (Platform: 2.1).

<uses-library android:name="com.google.android.maps" />

What am I doing wrong?

Thanks!!!


回答1:


Google API is a third party SDK. Choose third party in packages manager.




回答2:


You need to reference correct library at compile time. But what you describe is asking Android to use this specific library at runtime.

You need to right click your Eclipse project, Properties -> Android. In Project Build Target select any target with vendor Google Inc..



来源:https://stackoverflow.com/questions/8143330/mapactivity-cannot-be-resolved-to-a-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!