Android 中缺少共享库。

发布于 2024-08-21 18:00:13 字数 164 浏览 3 评论 0原文

02-18 00:02:08.432:错误/PackageManager(57):包 com.example.brown 需要不可用的共享库 com.google.android.maps;失败!

我在 logcat 中遇到了这个异常。

有人可以指导我吗?

02-18 00:02:08.432: ERROR/PackageManager(57): Package com.example.brown requires unavailable shared library com.google.android.maps; failing!

I got this exception in logcat.

Can anyone guide me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

忆梦 2024-08-28 18:00:13

正如 CommonsWare 所说,您的模拟器缺少该库。 Google 地图库文档的概述页面有关如何为模拟器创建正确类型的虚拟设备的信息。要点是:

使用不带任何选项的 android 命令启动 AVD 管理器。如果您在 Eclipse/ADT 中进行开发,您还可以从 Window > 访问该工具。 Android SDK 和 AVD 管理器。

  1. 点击“新建”按钮开始创建新的 AVD。
  2. 在出现的对话框中,指定 AVD 的名称并选择您希望 AVD 使用的系统映像目标。选择“Google API (Google Inc.)”目标之一,确保选择的版本的 API 级别与应用清单中的 android:minSdkVersion 属性相匹配,如上所述。
  3. 配置其他选项,然后点击“创建 AVD”。

完成创建 AVD 后,您可以从 AVD 管理器 UI 运行它,也可以使用模拟器的命令行界面。如果您在 Eclipse 中进行开发,则可以配置运行配置来启动 AVD 并在其上安装应用程序。

有关 AVD 的更多信息,请参阅 http://developer.android.com/guide/developing/tools/avd.html" rel="noreferrer">Android 虚拟设备 Android 开发者网站。

As CommonsWare said, your emulator is missing the library. The Google Maps Library's documentation's Overview page has info on how to create the right kind of virtual device for the emulator. The gist is:

Launch the AVD Manager by using the android command without any options. If you are developing in Eclipse/ADT, you can also access the tool from Window > Android SDK and AVD Manager.

  1. Click the "New" button to begin creating a new AVD.
  2. In the dialog that appears, specify a name for the AVD and select the system image target that you want the AVD to use. Select one of the "Google APIs (Google Inc.)" targets, making sure to choose a version whose API Level matches the android:minSdkVersion attribute in your application's manifest, as described above.
  3. Configure the other options and then click "Create AVD".

Once you've finished creating the AVD, you can run it from the AVD Manager UI or you can use the emulator's command-line interface. If you are developing in Eclipse, you can configure a Run Configuration to start the AVD and install your application on it.

For more information about AVDs, see Android Virtual Devices on the Android Developers site.

遗弃M 2024-08-28 18:00:13

我在真实设备上遇到了类似的问题。经过一番谷歌搜索后,我找到了这个答案

修复丢失的共享库。事实证明,在某些自定义 rom 上缺少 comp.google.android.map 库,您必须手动安装它。

  • 下载googleapps
  • 解压两个文件
  • system/etc/permissions/com.google.android.maps.xml
  • system/framework/com.google.android.maps.jar
  • 重新挂载 /system 文件系统 rw (mount -o rw,remount /system)
  • 复制 对其中的文件
  • 执行 chmod 644
  • 重新启动

I had the similar problem on a real device. After a loot of googling I found this answer

fixing missing shared library. It turns out that on some custom roms the comp.google.android.map library is missing, you have to install it manually.

  • download googleapps
  • extract two files
  • system/etc/permissions/com.google.android.maps.xml
  • system/framework/com.google.android.maps.jar
  • remount the /system filesystem rw (mount -o rw,remount /system)
  • copy the files in
  • do a chmod 644 on them
  • reboot
二手情话 2024-08-28 18:00:13

这个错误发生在我的实际设备上,而不是像其他答案那样的 AVD 上。就我而言,我在带有自定义 ROM 的 Nexus S 上运行,但未安装 Google 地图。

我在其他地方读到 com.google.android.maps 共享库与ROM 本身,不作为 APK 的一部分捆绑。

因此,我的解决方案是恢复到安装了 Google 地图的库存 ROM。

顺便说一句,该线程的标题是指在 DDMS LogCat 中发现的错误。大多数用户(在检查 LogCat 之前)看到的第一个错误将出现在 Eclipse 的控制台中:

Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY 
Please check logcat output for more details.

This error occurred to me on an actual device, not an AVD like the other answers. In my case I was running on a Nexus S with a custom ROM that did not have Google Maps installed.

I have read elsewhere that the com.google.android.maps shared library is bundled with the ROM itself and is not bundled as part of an APK.

Therefore the solution for me was to revert to the stock ROM which had Google Maps installed.

BTW, the title of this thread refers to an error that is found in the DDMS LogCat. The first error most users will see (before checking LogCat) will be in the console of Eclipse:

Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY 
Please check logcat output for more details.
后eg是否自 2024-08-28 18:00:13

您的模拟器缺少 Google API。创建一个包含 Google API 的新 AVD,此错误就会消失。

Your emulator is missing the Google APIs. Create a new AVD that contains the Google APIs, and this error should go away.

羁〃客ぐ 2024-08-28 18:00:13

作为 jfritz42,我在带有自定义 ROM (Cyanogenmod) 的真实设备上遇到了此错误。该错误的原因是我没有安装 Google Apps 软件包,因为它包含很多让我烦恼的应用程序。不过,有一个解决方案可以帮助您安装 google.maps 库,而无需使用此软件包中的 19 个 Google Apps 来整合您的系统。只需下载该软件包(zip 文件)并从该 zip 中的系统/应用程序中删除所有 .apk 文件。之后,您可以使用 ROM 管理器或通过恢复模式安装 zip。然后您应该在系统上安装地图库。此软件包中包含的 Google Apps(例如地图应用程序)可以随后单独安装。

As jfritz42 I got this error on a real device with a custom ROM (Cyanogenmod). The error was caused by the fact that I did not install the Google Apps package, since it contains a lot of apps that just annoy me. However, there is a solution how to install the google.maps library without massing up your system with the 19 Google Apps in this package. Just download the package (zip file) and remove all .apk files from system/app in this zip. Afterwards, you can install the zip by using the ROM Manager or via the recovery mode. Then you should have the maps library installed on your system. The Google Apps included in this package (e.g. the Maps app) can be installed separately afterwards.

私藏温柔 2024-08-28 18:00:13

如果使用真实设备,请尝试从清单文件中删除:

In case with real device try remove from manifest file:

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

回忆凄美了谁 2024-08-28 18:00:13

在正确设置 AVD 并正常工作后,我遇到过此错误。 AVD 仍在使用 Google API,我可以在 Eclipse 中看到对地图库的引用。我发现解决此问题的唯一方法是删除 AVD 并创建一个新的,按照 fiXedd 的建议。

I've experienced this error after the AVD was set up properly and working okay. The AVD was still using the Google APIs and I could see the reference to the maps library in Eclipse. The only way I found to resolve this was to delete the AVD and create a new one, as advised by fiXedd.

想念有你 2024-08-28 18:00:13

fiXedd(见上文)是正确的。

您可以编辑已创建的设备或创建新设备。当您在 AVD Manager 中创建或编辑设备时,不要选择此类版本目标:

Android xxx - API 级别 x

只需使用这种类型即可:

Google API (Google Inc.) - API 级别 x

fiXedd (see above) is correct.

You can edit devices you have already created or create a new one. When you create or edit a device inside the AVD Manager, instead of selecting this kind of version target:

Android x.x.x - API Level x

Simply use this kind instead:

Google APIs (Google Inc.) - API Level x

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文