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

18,666

Solution 1

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.

Solution 2

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.

Share:
18,666
detno29
Author by

detno29

Updated on July 01, 2022

Comments

  • detno29
    detno29 almost 2 years

    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.