Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MapActivity cannot be resolved to a type

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!!!

like image 564
Jesper Veldhuizen Avatar asked Nov 15 '11 21:11

Jesper Veldhuizen


2 Answers

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..

like image 83
Mohit Avatar answered Sep 29 '22 07:09

Mohit


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

like image 20
TheJohnny Avatar answered Sep 29 '22 08:09

TheJohnny