Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY on Kindle fire

别等时光非礼了梦想. 提交于 2019-12-04 03:42:03

问题


I am trying to run the demo android maps project(MapsDemo) that comes along with the Android SDK (Google API 10) on my Kindle Fire but it throws this exception when the application is installing.

[2012-01-31 23:01:15 - MapsDemo] Installing MapsDemo.apk...
[2012-01-31 23:01:17 - MapsDemo] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2012-01-31 23:01:17 - MapsDemo] Please check logcat output for more details.

and Log Cat

01-31 23:06:01.206: D/PackageManager(1372): Scanning package com.example.android.google.apis
01-31 23:06:01.206: E/PackageManager(1372): Package com.example.android.google.apis requires unavailable shared library com.google.android.maps; failing!
01-31 23:06:01.206: W/PackageManager(1372): Package com.example.android.google.apis couldn't be installed.

Same code works fine when i ran in my HTC Desire..

Is it possible to use KML and draw the routes using another way than using the Google APIs?

Anybody knows how to solve this issue ?


回答1:


You cannot use the Google Maps add-on for Android on the Kindle Fire, as it does not exist.

You can add android:required="false" to your <uses-library> element in the manifest, then check at runtime to see if the MapActivity class is available in your virtual machine:

try {
  Class.forName("com.google.android.maps.MapActivity");
  // if you get here, you have Google Maps, so you can safely start a MapActivity
}
catch (Exception e) {
  // if you get here, you do not have Google Maps
}

What you do in the "you do not have Google Maps" case, as you will encounter on the Fire, is up to you.



来源:https://stackoverflow.com/questions/9082784/installation-error-install-failed-missing-shared-library-on-kindle-fire

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!