문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

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.

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

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

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 you 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 (e.g. the Maps app) in this package can be installed separately afterwards.

In case with real device try remove from manifest file:

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

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.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top