简体   繁体   中英

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?

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

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管理器

Try adding the following to your build.gradle file:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM