Yves
Yves

Reputation: 1156

can't import com.google.android.maps.MapView

Unfortunately after a long day searching I couldn't find anything useful for me.

My Problem is that I couldn't use "extend MapActivity" or rather import the libary. I tried to use "Google API" insted of "Android API" like recomended in some other threads but the problem is that I have no "Google API" in my SDK Manager to download or choose.

My Android SDK Manager So, I have in my "Android SDK Manager" just the Android Apis from "Android 1.5 (API 3)" to "Android 4.0.3 (API 15)" and no "Google API".

Here is an example where the "Google API" is available inside the "Android 4.0.3 (API 15)" Installing the Google APIs...

Is there any posibility to download or import the "Google API" in a different way or am I doing something wrong?

Upvotes: 6

Views: 19256

Answers (3)

ARPITA BALI
ARPITA BALI

Reputation: 1

Try adding the following to your build.gradle file:

dependencies {
    compile 'com.google.maps.android:android-maps-utils:0.3+'
}

Upvotes: 0

user330844
user330844

Reputation: 880

I had the same problem with a different solution, I

  1. right clicked on my project in the Package Exploere and selected "Build Path->Configure Build Path"
  2. Selected "Java Build Path" and the "Libraries" tab
  3. Selected "Add External Jar"
  4. Navigated to my sdk/add-ons/addon-google_apis_google_inc_-/libs
  5. Selected "maps.jar"

I was then able to import com.google.maps.*

Upvotes: 12

Martin Sykes
Martin Sykes

Reputation: 2641

You may want to add the "Android" tag to your question to get better help.

The "Google APIs" should be listed within 'some' of the Android API's as a subcatory on the Android SDK Manager. I just checked my SDK manager and Google Apis can be selected and installed within Android 1.6, 2.1 and 4.0

Hope this helps, if not re-download and re-install the Android SDK manager? Android SDK manager

Upvotes: 3

Related Questions