当我在 AndroidManifest.xml 文件中指定 preferExternal 时,我无法将应用程序安装到虚拟设备(API 10 和 17)。
控制台输出:
[2013-06-11 12:01:51 - MyApp] Android Launch!
[2013-06-11 12:01:51 - MyApp] adb is running normally.
[2013-06-11 12:01:51 - MyApp] Performing com.mydomain.MyApp.activities.ChannelActivity activity launch
[2013-06-11 12:01:51 - MyApp] Automatic Target Mode: Preferred AVD 'NexusS_API17' is available on emulator 'emulator-5554'
[2013-06-11 12:01:51 - MyApp] Uploading MyApp.apk onto device 'emulator-5554'
[2013-06-11 12:01:55 - MyApp] Installing MyApp.apk...
[2013-06-11 12:01:59 - MyApp] Installation error: INSTALL_FAILED_CONTAINER_ERROR
[2013-06-11 12:01:59 - MyApp] Please check logcat output for more details.
[2013-06-11 12:01:59 - MyApp] Launch canceled!
LogCat 输出:
06-11 10:01:57.385: W/ActivityManager(302): No content provider found for permission revoke: file:///data/local/tmp/MyApp.apk
06-11 10:01:57.755: I//system/bin/make_ext4fs(32): Creating filesystem with parameters:
06-11 10:01:57.755: I//system/bin/make_ext4fs(32): Size: 2158592
06-11 10:01:57.755: I//system/bin/make_ext4fs(32): Block size: 4096
06-11 10:01:57.755: I//system/bin/make_ext4fs(32): Blocks per group: 32768
06-11 10:01:57.755: I//system/bin/make_ext4fs(32): Inodes per group: 144
06-11 10:01:57.755: I//system/bin/make_ext4fs(32): Inode size: 256
06-11 10:01:57.766: I//system/bin/make_ext4fs(32): Journal blocks: 0
06-11 10:01:57.775: I//system/bin/make_ext4fs(32): Label:
06-11 10:01:57.775: I//system/bin/make_ext4fs(32): Blocks: 527
06-11 10:01:57.775: I//system/bin/make_ext4fs(32): Block groups: 1
06-11 10:01:57.785: I//system/bin/make_ext4fs(32): Reserved block group size: 7
06-11 10:01:57.795: I//system/bin/make_ext4fs(32): Created filesystem with 11/144 inodes and 23/527 blocks
06-11 10:01:57.846: I/Vold(32): Filesystem (ext4) formatted OK
06-11 10:01:57.855: E/Vold(32): ASEC FAT mount failed (No such device)
06-11 10:01:57.926: E/PackageHelper(1091): Failed to create secure container smdl2tmp1
06-11 10:01:57.926: E/DefContainer(1091): Failed to create container smdl2tmp1
06-11 10:01:57.937: W/ActivityManager(302): No content provider found for permission revoke: file:///data/local/tmp/MyApp.apk
看起来人们过去曾遇到过与smdl2tmp1类似的问题,但我的 AVD 没有 smdl2tmp1.asec 文件。我尝试了很多事情:
- 重新创建 AVD。
- 在 ADB 中使用 umount 卸载 /mnt/sdcard(我让设备忙)。
- 使用全新安装的 ADT 22 在另一台计算机上重建开发环境。
有没有人对我如何让我的应用程序安装在外部 sdcard 上有任何建议?安装到内部存储时运行良好。