Android安装应用程序出现“INSTALL_FAILED_CONTAINER_ERROR”错误的解决办法

时间:2022-12-18 11:53:25
通过手机安装应用提示“应用未安装”。用豌豆荚、apkinstaller安装也都装不上。logcat没找到错误原因。最后用adb install发现了错误:
failed 【INSTALL_FAILED_CONTAINER_ERROR】。 貌似在android2.2以后才会遇到这个问题。

遇到这个问题解决办法是:
1. 数据线连接电脑,以“磁盘驱动器”方式连接。
2. 进入sdcard下的.android_secure目录(需要使用第三方的资源管理器)
3. 删除该目录下的smdl2tmp1.asec文件。

如果该目录没有使用smdl2tmp1.asec文件,adb shell执行如下命令:
rm /mnt/secure/asec/smdl2tmp1.asec
再看了一遍logcat,终于发现了fail信息:

D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> smdl2tmp1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.flightmanager.view-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.hiapk.market-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.rovio.angrybirds-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.baidu.BaiduMap-2
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.eassol.android-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.tudou.android-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.droidhen.fruit-2
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.icontact.dazhong.ui-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> cn.com.fetion-2
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> uc.ucdl-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.dragon.android.pandaspace-2
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.MetalStorm2-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.tencent.qqpim-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> youcan.reader-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.caing.news-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.bf.sgs-1
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> uavana.gmaps-2
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.blovestorm-2
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.hiapk.marketpho-2
D/VoldCmdListener(   86): CommandListener::AsecCmd::runCommand -> com.google.android.stardroid-1
I/PackageHelper( 2809): Size of container 4 MB 2831852 bytes
E/PackageHelper( 2809): Failed to create secure container smdl2tmp1
E/DefContainer( 2809): Failed to create container smdl2tmp1
D/VoldCmdListener(   86): volume aseced /mnt/sdcard
D/MountService(  174): getAsecVolumeState :: result = mounted
D/MountService(  174):  :::: createSecureContainer :: id = smdl2tmp1, sizeMb = 4, fstype = fat, key
= a105d52f864a3aaccb97848a73dc3b5b, ownerUid = 10048
D/VoldCmdListener(   86): asec create smdl2tmp1 4 fat {} 10048
E/Vold    (   86): ASEC file '/mnt/secure/asec/smdl2tmp1.asec' currently exists - destroy it first!
(Address already in use)
W/Vold    (   86): Returning OperationFailed - no handler for errno 98
I/ActivityManager(  174): No longer want com.wd.AndroidDaemon (pid 2467): hidden #16
I/KeyInputQueue(  174): Enqueueing touch event0
I/WindowManager(  174): Read next event 0
I/WindowManager(  174): Delivering pointer 0 > Window{4a6ed918 com.android.packageinstaller/com.andr
oid.packageinstaller.InstallAppProgress paused=false}
I/KeyInputQueue(  174): Enqueueing touch event1
I/WindowManager(  174): Read next event 1
I/WindowManager(  174): Delivering pointer 1 > Window{4a6ed918 com.android.packageinstaller/com.andr
oid.packageinstaller.InstallAppProgress paused=false}
I/InstallAppProgress( 2794): Finished installing com.sina.weibo