INSTALL_FAILED_INSUFFICIENT_STORAGE错误是每个Android开发人员的烦恼。这与应用程序大小或可用存储空间大小无关。重新启动目标设备可以短暂地修复问题,但它很快就会回来。人们在留言板上发帖询问为什么会出现这个问题,但令人沮丧的是,谷歌的人对这个问题保持沉默。

有一个简单的变通办法。如果您的测试设备运行的是Android 2.2或更高版本,那么将Android:installLocation属性添加到应用程序的清单文件中,值为“preferExternal”。这将迫使应用程序安装在设备的外部存储设备上,比如手机的SD卡。

例如:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.andrewsmith.android.darkness"
          android:installLocation="preferExternal"

这更像是一种创可贴,而不是补救措施,如果你想要完成的应用程序安装在设备的内部内存中,这可能不太理想。但它至少会让开发过程不那么令人沮丧。


当前回答

如果您在模拟器上运行应用程序,如果此问题仍然存在,请检查通知管理器。如果它显示一个图标,并通知“手机内存已满”,这意味着您已经在模拟器上安装了如此多的应用程序。从“设置>>管理应用程序>>选择应用程序>>卸载”中卸载当前不需要的多个应用程序。 这集。 现在重新运行程序。

其他回答

我已经解决了这个问题,包括android:installLocation="auto"内<manifest>标签在AndroidManifest.xml文件。

我尝试了以下方法:

重启我的设备 删除之前的APK 重建我的APK 卸载我之前在设备中的副本 重新安装

检查它对你是否同样有效。

处理:

编译为2.1不含android:installLocation="preferExternal"。

OK?

编译为2.2,包括android:installLocation="preferExternal"。

这仍然会安装在SDK版本小于8的版本上(XML标记被忽略)。

您需要增加Android模拟器的内存容量。有两种方法:

Right click the root of your Android Project, go to "Run As" and then go to "Run Configurations...". Locate the "Android Application" node in the tree at the left, and then select your project and go to the "Target" tab on the right side of the window look down for the "Additional Emulator Command Line Options" field (sometimes you'll need to make the window larger) and finally paste "-partition-size 1024" there. Click Apply and then Run to use your emulator. Go to Eclipse's Preferences, and then select “Launch” Add “-partition-size 1024” on the “Default emulator option” field. Click “Apply” and use your emulator as usual.

我的手机没有root权限,也没有准备好把我的应用程序安装在SD卡上。/data/上有15 MB的可用空间,而我的应用程序不足2 MB。

有一段时间我还过得去;清理Eclipse项目并重新启动手机,但最终停止工作(可能是在更新之后)。

清理我的应用程序缓存为我解决了这个问题,不需要重新启动手机或卸载应用程序。

市场上有一些应用程序可以一次性清除多个应用程序的缓存。搜索“干净”。