解决INSTALL_FAILED_INSUFFICIENT_STORAG​​E错误在Android [英] Solution to INSTALL_FAILED_INSUFFICIENT_STORAGE error on Android

查看:183
本文介绍了解决INSTALL_FAILED_INSUFFICIENT_STORAG​​E错误在Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该INSTALL_FAILED_INSUFFICIENT_STORAG​​E错误是每个Android开发的一生的祸根。它发生的应用程序的大小,不管,或有多少存储可用。重新启动目标设备解决了这个问题简单,但它很快就回来。也有留言板帖子由数百人(如果不是数千名)问为什么出现问题,但人们在谷歌上的问题令人沮丧的沉默。

The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every Android developer's life. It happens regardless of app size, or how much storage is available. Rebooting the target device fixes the problem briefly, but it soon comes back. There are hundreds (if not thousands) of message board posts from people asking why the problem occurs, but the folks at Google are frustratingly silent on the issue.

有一个简单的解决方法。如果您的测试设备运行的是Android 2.2或更高版本,然后添加机器人:INSTALLLOCATION 属性到应用程序的清单文件,其值为 preferExternal 。这将迫使要在设备的外部存储,安装应用程序,如手机的SD卡。

There is a simple workaround. If your test device is running Android 2.2 or later then add the android:installLocation attribute to your application's manifest file, with the value "preferExternal". This will force the app to be installed on the device's external storage, such as a phone's SD card.

例如:

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

这更多的是一种治标不修复的,如果你想完成的应用安装在设备的内存中它可能不是很理想。但它至少使开发过程少了很多令人沮丧的。

This is more of a band-aid than a fix, and it may not be ideal if you want your finished app to install on the device's internal memory. But it will at least make the development process a lot less frustrating.

推荐答案

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

You need to increase the Android emulator's memory capacity. There are two ways for that:

  1. 右键单击您的Andr​​oid项目的根目录下,进入运行方式,然后进入运行配置...。找到位于左侧的树中的Android应用程序节点,然后选择您的项目,然后转到目标选项卡上右侧的窗口往下看,为附加仿真器的命令行选项域(有时你'会需要使窗口变大),最后贴上-partition尺寸1024在那里。单击Apply,然后运行使用你的模拟器。

  1. 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.

转到 Eclipse的 preferences,然后选择启动添加 -partition尺寸1024上的默认仿真器选项字段。点击应用,并使用你的模拟器像往常一样。

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.

这篇关于解决INSTALL_FAILED_INSUFFICIENT_STORAG​​E错误在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆