Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not import com.google.android.maps.MapActivity

I try to import com.google.android.maps.MapActivity but my program can not recognize it. I also have <uses-library android:name="com.google.android.maps" /> and set the apiKey in my project.

Can anybody explain why I can import the above line? Thanks in advance.

like image 264
detno29 Avatar asked Mar 10 '12 11:03

detno29


2 Answers

What Android Version to you use ? On your project Settings make sure that you use a Project Build Target that contains the google api. Normally they are names "Google APIs".

I included an image of the project settings. Select the one which says "Google APIs". They should include the needed packages.

like image 149
Norman Avatar answered Oct 22 '22 12:10

Norman


Right click in your project and select Properties, then select Android > Google APIs from Google Inc. version 2.2 or above. Be sure to choose any of the Google APIs instead of the Android 2.2 or above APIs since only Google APIs have the android.maps library.

like image 32
Edison Santos Avatar answered Oct 22 '22 12:10

Edison Santos