今天非常奇怪,在安装手机的时候出现下面的错误
isstall failed Missing shareed libary com.google.android.maps
经过一番搜寻发现下面这篇文章:http://www.callum-macdonald.com/2011/02/06/missing-com-google-android-maps/
归根到底,是手机里缺少文件。不知道HTC竟然会有这种情况发生。难道是水货的问题?
使用google map apd时,手机中需要两个文件:(使用DDMS可以一览无遗)
/system/etc/permissions/com.google.android.maps.xm
/system/framework/com.google.android.maps.jar
在我发现问题的手机里有maps.jar,但是缺少第一个权限文件。。。。。
这种情况我不得不在manifest.xml中注释掉map api的use libary代码。。。
哎。。适配的前途渺茫啊。。。
Thanks to this post, and a whole heap of other stuff, I finally sorted out a Google Maps problem on my Nexus One.
When trying to install some apps, I would see this error message in logcat:
requires unavailable shared library com.google.android.maps
I had the Google Maps app installed and working, but that didn’t fix the issue. It turns out, I had to add two other files and restart the phone. I found those files in the google zip from Cyanogenmod. It took a little fiddling, but I was able to use these instructions to remount /system in write mode. First step was to take the following two files from the google apps zip (gapps-hdpi-20101114-signed.zip) and put them onto my sd card.
/system/etc/permissions/com.google.android.maps.xml
/system/framework/com.google.android.maps.jar
Then to load them onto the phone, I opened the terminal emulator and ran:
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cp /mnt/sdcard/com.google.android.maps.xml /system/etc/permissions/
cp /mnt/sdcard/com.google.android.maps.jar /system/framework/
Then after I rebooted the phone, I was able to install apps that depend on Google Maps. I can now check bus and train times, and do all kinds of other cool stuff with maps!
Note, this is only relevant if you do not want all Google Apps installed. I only have the map application installed as I don’t sync my phone with any Google services. If you’re using all the Google Apps, I suggest reinstalling as these steps should not be necessary.
To add a little colour, here’s an unrelated picture from flickr, courtesy of epSos.de