eclipse 无法导入 com.google.android.maps.MapView

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9950344/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 17:56:45  来源:igfitidea点击:

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

javaandroideclipseeclipse-pluginmaps

提问by Yves

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.

我的问题是我无法使用“扩展 MapActivity”或导入库。我尝试使用“Android API”插入的“Google API”,就像在其他一些线程中推荐的那样,但问题是我的 SDK 管理器中没有“Google API”可供下载或选择。

My Android SDK ManagerSo, 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".

我的 Android SDK 管理器因此,我在“Android SDK 管理器”中只有从“Android 1.5 (API 3)”到“Android 4.0.3 (API 15)”的 Android API,没有“Google API”。

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

以下是“Android 4.0.3 (API 15)”中“Google API”可用的示例安装 Google API...

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

是否有可能以不同的方式下载或导入“Google API”,或者我做错了什么?

回答by user330844

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"
  1. 右键单击 Package Exploere 中的我的项目并选择“构建路径->配置构建路径”
  2. 选择“Java Build Path”和“Libraries”选项卡
  3. 选择“添加外部罐子”
  4. 导航到我的 sdk/add-ons/addon-google_apis_google_inc_-/libs
  5. 选择“maps.jar”

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

然后我就可以导入 com.google.maps.*

回答by Martin Sykes

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

您可能希望在问题中添加“Android”标签以获得更好的帮助。

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

“Google API”应作为 Android SDK 管理器的子目录列在“某些”Android API 中。我刚刚检查了我的 SDK 管理器,可以在 Android 1.6、2.1 和 4.0 中选择和安装 Google Apis

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

希望这会有所帮助,如果没有重新下载并重新安装 Android SDK 管理器? Android SDK 管理器

回答by ARPITA BALI

Try adding the following to your build.gradle file:

尝试将以下内容添加到您的 build.gradle 文件中:

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