com.google.android.maps 不见了?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1996173/
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-08-20 04:07:35  来源:igfitidea点击:

com.google.android.maps missing?

android

提问by Jeff

new to Android. Checked the FAQs on the SDK site but didn't find anything that was helpful.

安卓新手。检查了 SDK 站点上的常见问题解答,但没有找到任何有用的信息。

I'm learning via a few books w/downloadable code. One of the examples I'd like to get running won't even compile because the IDE can't find/import the com.google.android.mapslibrary/package, which I found odd since I have everything possible installed that the SDK offers. The book info on the publisher site was not helpful either. Any ideas?

我正在通过一些带有可下载代码的书来学习。我想要运行的示例之一甚至无法编译,因为 IDE 无法找到/导入com.google.android.maps库/包,我发现这很奇怪,因为我已经安装了 SDK优惠。出版商网站上的图书信息也没有帮助。有任何想法吗?

I'm using Eclipse (build 20090920-1017) with the ADT 0.9.5 plugin. SDK is fully updated (all available packages installed, including android 1.1 api 2 rev. 1 through android 2.0.1 api6 rev 1, and google apis 3 rev 3 through 6 rev 1.)

我正在使用带有 ADT 0.9.5 插件的 Eclipse(构建 20090920-1017)。SDK 已完全更新(已安装所有可用软件包,包括 android 1.1 api 2 rev.1 到 android 2.0.1 api6 rev 1,以及 google apis 3 rev 3 到 6 rev 1。)

Any advice is appreciated.. thanks in advance.

任何建议表示赞赏.. 提前致谢。

回答by Maksym Gontar

Choose "Google API" project Build Target. And be sure Google API is installed in you Android SDK.
And don't forget to add

选择“Google API”项目构建目标。并确保您的 Android SDK 中安装了 Google API。
并且不要忘记添加

<uses-library android:name="com.google.android.maps" />

into tag in ApplicationManifest.xml

进入 ApplicationManifest.xml 中的标记

回答by jimmy

Switch to "Google API" as project Build Target works for me.

切换到“Google API”,因为项目 Build Target 对我有用。

Project->properties->android, check GOOGLE API

项目->属性->android,查看GOOGLE API

回答by Jay Gajjar

  1. Install all google API's using sdk manager.

  2. In your manifest,under application element add

    <uses-library android:name="com.google.android.maps" />
    
  3. You have to include jar file for maps also.. Right click on your project and go to build path and then add external archives. locate your sdk. android-sdk-windows\add-ons\addon_google_apis_google_inc_<your api version>\libs\maps
  1. 使用 sdk 管理器安装所有 google API。

  2. 在您的清单中,在应用程序元素下添加

    <uses-library android:name="com.google.android.maps" />
    
  3. 您还必须为地图包含 jar 文件。右键单击您的项目并转到构建路径,然后添加外部档案。找到你的sdk。android-sdk-windows\add-ons\addon_google_apis_google_inc_<your api version>\libs\maps

回答by Mani

Me too got this Error even though I Inserted

即使我插入了,我也遇到了这个错误

<uses-library android:name="com.google.android.maps"/>

I struggled to solve this problem for a long time...

我努力解决这个问题很长一段时间......

Then Cleaningand RebuildingProject solves the Issue

然后清理重建项目解决了这个问题

回答by Bruno Pinto

To develop with google maps I recommend you to use Genymotioninstead eclipse emulator.

要使用谷歌地图进行开发,我建议您使用Genymotion而不是 eclipse 模拟器。

回答by user364622

Remember always to add uses library in appication branch. Like this:

请记住始终在应用程序分支中添加使用库。像这样:

I had also the same problem but i had added uses library not in application

我也有同样的问题,但我在应用程序中添加了使用库

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.MapsTest"
     android:versionCode="1"
     android:versionName="1.0.0">
     <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".MapsTest"
                 android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.google.android.maps"/>
    </application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
</manifest>

Parsed in 0.004 seconds, using GeSHi 1.0.8.4

0.004 秒解析,使用 GeSHi 1.0.8.4