您的位置:首页 > 大数据 > 人工智能

Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE

2016-09-22 15:18 344 查看
声明:此篇博客是根据爱情已欠费的博客改编而成,感谢原作者的智慧!

问题描述:

用eclipse编译程序,然后在Android手机上运行,报错如下:

[2012-06-21 12:56:17 - xmobile17] Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE

[2012-06-21 12:56:17 - xmobile17] Please check logcat output for more details.

[2012-06-21 12:56:18 - xmobile17] Launch canceled!

使用logcat查看log,显示错误如下:

NOTE: attach of thread ‘Binder Thread #3’ failed

原因是某些应用程序(如360、91手机助手)造成手机无法在SD卡上安装程序

解决方法:

卸载这些垃圾软件,或者使用adb shell让手机自己选择安装在哪里,命令如下:

adb shell

pm setInstallLocation 0

PS.不同的setInstallLocation说明:

pm set-install-location 0 由App自行决定软件能否安装在SD卡

pm set-install-location 1 强制全部App安装在ROM内

pm set-install-location 2 强制全部App安装在SD卡



PS:如果是手机连接PC的模式,选择了存储模式,导致找不到存储卡,也会报此错误
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: