Android上INSTALL_FAILED_INSUFFICIENT_STORAGE错误的解决方案

发布于 2024-10-12 11:07:05 字数 1707 浏览 9 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(30

音盲 2024-10-19 11:07:05

这只是一个临时解决方法,而不是真正的解决方案。

在我遇到这种情况并且对当前的反应不满意之后,我去上班了
试图从 AOSP 源中找出答案。我找到了一个真实解决方案。

说明

首先,介绍一些关于 Android 如何安装和更新的背景知识

第一次安装应用程序:

  1. APK 文件另存为

    /data/app/-1.apk (1.apk)
    

应用程序何时更新:

  1. 更新后的 APK 文件另存为:

    /data/app/-2.apk (2.apk)
    
  2. 第一个版本 (1.apk) 被删除。

关于我们的下一次更新:

  1. 新 APK 保存为 (1.apk),并删除 (2.apk)(永远重复)。

 

我们大多数人遇到的问题是在更新应用程序但删除旧 APK 失败时发生的。它本身还不会导致更新失败,但它确实会导致 /data/app 中有两个 APK 文件。

下次您尝试更新应用程序时,系统无法移动其临时文件,因为 (1.apk) 和 (2.apk) 都不为空。由于 File#renameTo(File) 不会抛出异常,而是返回一个布尔值 PackageManager,因此它没有任何方法来告诉它为什么返回 INSTALL_FAILED_INSUFFICIENT_STORAGE,即使失败与可用空间量无关。

解决方案

运行:

adb shell "pm uninstall <full.packge.name>"
adb shell "rm -rf /data/app/<full.package.name>-*"

卸载应用程序

使用您喜欢的方法删除两者

/data/app/-1.apk

/data/app/-2.apk

确保没有其他内容以类似的方式阻止将来的安装。就我而言,我有一个 /data/app-lib/-1 目录徘徊!在这种情况下,安装到 SD 卡 可以正常工作,随后也可以移动到内部存储器。 (创建 /data/app-lib/ 而没有 -1 结尾。)

为什么其他“解决方案”有效

  • 代码安装到外部存储的代码明显不同,不会出现相同的问题

  • 卸载应用程序只会删除其中一个版本的 APK 文件<代码> /数据/应用程序。这就是为什么您可以重新安装一次,但不能更新它。

  • 发生此错误时,模拟器中的可用空间量并不真正相关

This is only a temporary workaround and not a real fix.

After having this happen to me and not being pleased with the current responses I went to work
trying to figure it out from the AOSP source. I have found a REAL solution.

Explanation

First off, a bit of (simplified) background on how Android installs and updates

The first time an app is installed:

  1. The APK file is saved as

    /data/app/<full.package.name>-1.apk  (1.apk)
    

When the app is to be updated:

  1. The updated APK file is saved as:

    /data/app/<full.package.name>-2.apk (2.apk)
    
  2. The first version (1.apk) gets deleted.

On our next update(s):

  1. The new APK is saved as (1.apk) and (2.apk) is deleted (Repeat forever).

 

The issue that most of us are having happens when the application is updated, but deleting of the old APK fails. Which itself does not yet cause the update to fail, but it does cause there to be two APK files in /data/app.

The next time you try to update the app the system can't move its temporary file because neither (1.apk) nor (2.apk) are empty. Since File#renameTo(File) doesn't throw an exception but instead returns a boolean PackageManager, it doesn't have any way to tell why it returns INSTALL_FAILED_INSUFFICIENT_STORAGE even though the failure had nothing to do with the amount of free space.

Solution

Run:

adb shell "pm uninstall <full.packge.name>"
adb shell "rm -rf /data/app/<full.package.name>-*"

OR

Uninstall the app

Use your favorite method to delete BOTH:

/data/app/<full.package.name>-1.apk

/data/app/<full.package.name>-2.apk

Make sure nothing else blocks future installs in a similar way. In my case I had a /data/app-lib/<full.package.name>-1 directory lingering around! In this case, an install to the SD card worked, and a subsequent move to internal memory, too. (Creating /data/app-lib/<full.package.name> without the -1 ending.)

Why other "solutions" worked

  • The code for installing to external storage is significantly different which does not have the same problems

  • Uninstalling the app only deletes one version of the APK file in /data/app. That's why you can reinstall it once, but not update it.

  • The amount of free space in an emulator isn't really relevant when this bug occurs

撑一把青伞 2024-10-19 11:07:05

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

  1. 右键单击 Android 项目的根目录,转到“运行方式”,然后转到“运行配置...”。在左侧树中找到“Android 应用程序”节点,然后选择您的项目并转到窗口右侧的“目标”选项卡,向下查找“其他模拟器命令行选项”字段(有时您会我需要使窗口更大)并最后粘贴“-partition-size 1024”。单击“应用”,然后单击“运行”以使用模拟器。

  2. 转到 Eclipse 的首选项,然后选择“启动”添加“- “默认模拟器选项”字段中的“分区大小 1024”。单击“应用”并照常使用模拟器。

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

  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.

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

酒浓于脸红 2024-10-19 11:07:05

以下内容有帮助:

  • 打开设备的 shell

    adb shell
    
  • 导航到首次复制传入 APK 的临时目录

    cd /data/local/tmp
    
  • 列出可用文件并根据需要删除

    rm * // 使用风险自负,最好先列出文件
    

到目前为止,这在实际设备上对我来说是可靠的。


编辑:事实证明,这种解决方案不如上面的解决方案可靠。

我尝试了多种解决方案。没有任何帮助。最后我找到了一个名为 SD Maid 的应用。这很有帮助。

它说该功能在未root的设备上受到限制。我的问题是根深蒂固的,所以很高兴能听到人们的意见,它在这些情况下是有效的,如果它对我有用只是侥幸(无论如何,这是一个不可预测的问题)。

注意:我与该应用程序无关。刚刚通过搜索找到了它。

The following helps:

  • Open a shell to the device

    adb shell
    
  • Navigate to the temp directory where the incoming APK is first copied

    cd /data/local/tmp
    
  • List the available files and delete as desired

    rm * // use at your own risk, good practice to list files first
    

This has been reliable for me so far on an actual device.


EDIT: This turned out to be not as reliable a solution as the one above.

I tried a number of the solutions. Nothing really helped. Finally I found an app called SD Maid. That helped.

It says the functionality is limited on unrooted devices. Mine is rooted so it would be good to see hear from people effective it is in those scenarios and if it was just a fluke that it worked for me (it is an unpredictable problem anyway).

NOTE: I have nothing to do with the app. Just found it with a search.

太阳公公是暖光 2024-10-19 11:07:05

感谢您发布这个问题。我有一些额外的见解可能会对一些开发人员有所帮助。

我正在设备(不是模拟器)上调试我的应用程序。该设备在 /data 上有 21MB 可用空间(如执行“adb shell”时“df”显示的那样),而我的应用程序只有 5MB。但是,我确实发现,如果我删除了设备上的其他应用程序(没有重新启动手机或重新启动 adbd),INSTALL_FAILED_INSUFFICIENT_STORAGE 会消失一段时间,然后又回来。

因此,调试我的 5 MB 应用程序似乎需要 /data 中的 20 MB 空间,此外,每次调试应用程序时都会泄漏一些东西。

所以我执行了“adb shell”并列出了整个 /data 目录

cd /data
ls -a -l -R

,然后我查看了 5000 行输出以了解所有空间都去了哪里。

我在设备上的 /data/klog 目录中发现了大量浪费的空间,这些空间以几个月前的调试会话中的旧日志文件的形式存在。

这些不是我的日志文件:它们是由 Android 基础设施的某些部分创建的。

我删除了它们并立即节省了 58 MB 的空间,这些空间在“设置”应用程序中并未归属于任何特定应用程序。我的设备很小,所以 58MB 非常重要(大约 40%)。

到目前为止,多次运行后我还没有再次获得 INSTALL_FAILED_INSUFFICIENT_STORAGE 。我们希望这是真正的问题,尽管OP表示他的设备有足够的空间(但没有说有多少)。

希望你们中的一些人也能够通过定期删除 /data/klog/* 来逃避 INSTALL_FAILED_INSUFFICIENT_STORAGE。

或者,您至少可以在 /data 中执行 ls -a -l -R 来查看所有空间的去向,如果确实有一些(隐藏的)空间问题。

Thanks for posting this question. I have some additional insights that may help some developers.

I am debugging my application on a device (not the emulator). The device has 21 MB free on /data (as revealed by "df" when doing "adb shell") and my app is only 5 MB. However, I did find that if I deleted other apps on the device (without rebooting the phone or restarting adbd), INSTALL_FAILED_INSUFFICIENT_STORAGE would go away for a while and then come back.

So it seems that debugging my 5 MB app requires more like 20 MB of space in /data, and in addition something was leaking each time I debugged my app.

So I did "adb shell" and listed the ENTIRE /data directory with

cd /data
ls -a -l -R

And I looked at the 5000-line output to see where all the space was going.

I discovered vast quantities of wasted space on my device in the /data/klog directory in the form of old log files from months-old debugging sessions.

These were not my log files: they were created by some part of the Android infrastructure.

I deleted them and instantly saved 58 MB which was not attributed in the Settings app to any particular app. I have a small device so 58 MB is very significant (about 40%).

So far, I have not gotten INSTALL_FAILED_INSUFFICIENT_STORAGE again after many runs. Let's hope that was the real issue, though the OP suggests that his device had plenty of space (but didn't say how much).

Hopefully some of you will also be able to escape INSTALL_FAILED_INSUFFICIENT_STORAGE by periodically deleting /data/klog/*.

Or, you can at least do the ls -a -l -R in /data to see where all your space is going, if indeed there is really some (hidden) space issue.

眼泪淡了忧伤 2024-10-19 11:07:05

我通过在 AndroidManifest.xml 文件中的 标记中包含 android:installLocation="auto" 解决了这个问题。

I have solved it by including android:installLocation="auto" inside <manifest> tag in AndroidManifest.xml file.

烂人 2024-10-19 11:07:05

我在应用程序的清单文件中添加了一行额外的内容,即 android:installLocation="preferExternal"。通过使用此行,它会强制将应用程序安装到外部存储。请参阅下面的示例,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nasir.phonegap"
    android:installLocation="preferExternal" >

I had added an additional line to the application's manifest file, which is android:installLocation="preferExternal". by using this line it forces to install the app to the external storage. see the example below,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nasir.phonegap"
    android:installLocation="preferExternal" >
遮了一弯 2024-10-19 11:07:05

我尝试了以下操作:

  • 重新启动我的设备
  • 删除以前的 APK
  • 重建我的 APK
  • 卸载设备中以前的副本
  • 重新安装

检查它是否适合您。

I tried the following:

  • Restarted my device
  • Deleted previous APK
  • Rebuild my APK
  • Uninstall my previous copy in the device
  • Reinstall

Check if it works the same with you.

晚风撩人 2024-10-19 11:07:05

模拟器上的一个相关问题是 /data 分区中没有剩余空间。

例如,

% adb shell df

Filesystem             Size   Used   Free   Blksize
/dev                   252M    32K   252M   4096
/mnt/asec              252M     0K   252M   4096
/mnt/obb               252M     0K   252M   4096
/system                154M   154M     0K   4096
/data                   64M    57M     6M   4096
/cache                  64M     1M    62M   4096

以下是 /data/app 目录的示例视图:

% adb shell ls -l /data/app

-rw-r--r-- system   system      19949 2011-10-12 17:09 CubeLiveWallpapers.apk
-rw-r--r-- system   system      27670 2011-10-12 17:09 GestureBuilder.apk
-rw-r--r-- system   system      34341 2011-10-12 17:09 SoftKeyboard.apk
-rw-r--r-- system   system      20151 2011-10-12 17:09 WidgetPreview.apk

我删除了额外的 APK 文件。似乎每次安装都会得到一个新的 APK 文件。只需删除多余的 APK 文件即可。

例如,

adb shell rm /data/app/com.brooklynmarathon.calendarapi2-1.apk

A related issue on the emulator is when there isn'y any space left in the /data partition.

For example,

% adb shell df

Filesystem             Size   Used   Free   Blksize
/dev                   252M    32K   252M   4096
/mnt/asec              252M     0K   252M   4096
/mnt/obb               252M     0K   252M   4096
/system                154M   154M     0K   4096
/data                   64M    57M     6M   4096
/cache                  64M     1M    62M   4096

Here is a sample view of the /data/app directory:

% adb shell ls -l /data/app

-rw-r--r-- system   system      19949 2011-10-12 17:09 CubeLiveWallpapers.apk
-rw-r--r-- system   system      27670 2011-10-12 17:09 GestureBuilder.apk
-rw-r--r-- system   system      34341 2011-10-12 17:09 SoftKeyboard.apk
-rw-r--r-- system   system      20151 2011-10-12 17:09 WidgetPreview.apk

I removed the extra APK files. It seems upon every install you get a new APK file. Just remove the extra APK files.

For example,

adb shell rm /data/app/com.brooklynmarathon.calendarapi2-1.apk
浮云落日 2024-10-19 11:07:05

就我而言,失败是由 com.android.providers.media 应用程序引起的。我在 x86 android 模拟器上遇到了这个问题。我做了什么:

$ adb shell df
Filesystem             Size   Used   Free   Blksize
...
/data                  224M   209M    14M   4096
....

/data 上的可用空间太低

$ adb shell du /data
...
409870  /data/data/com.android.providers.media
...

几乎所有空间都被单个应用程序消耗了!这是系统应用程序,所以我认为最好不要删除它。相反,我清理了应用程序数据。

$ adb shell pm clear com.android.providers.media
Success
$ adb shell df
Filesystem             Size   Used   Free   Blksize
...
/data                  224M     8M   215M   4096
...

磁盘已清除,应用程序安装成功。

In my case failure was caused by com.android.providers.media app. I faced this on x86 android emulator. What did I do:

$ adb shell df
Filesystem             Size   Used   Free   Blksize
...
/data                  224M   209M    14M   4096
....

Too low free space on /data

$ adb shell du /data
...
409870  /data/data/com.android.providers.media
...

Almost all was consumed by single app! It's system app so I consider better not to delete it. Instead I cleaned up app data.

$ adb shell pm clear com.android.providers.media
Success
$ adb shell df
Filesystem             Size   Used   Free   Blksize
...
/data                  224M     8M   215M   4096
...

Disk was cleared and app installed successfully.

慈悲佛祖 2024-10-19 11:07:05

回答本主题的第一篇文章...

症状:某些应用程序无法安装,说没有空间
事实上,内部和外部存储都有足够的可用空间!
解决方案:默认禁用外部安装。

默认设置外部安装:

adb shell pm set-install-location 2

使得许多无法外部安装的应用程序无法安装(例如adblock +等)

然后解决方案是

adb shell pm set-install-location 0

或者

adb shell pm set-install-location 1

0: auto (if one is full - or irrelevant !!! - it select the other)
1: internal
2: external

Answering to the very first post of this topic...

Symptom : Some app don't install, saying there is no space
and in reallity there is plenty of space free on both internal and external storage !!!
Solution: disable external installation by default.

Setting external install by defaut with this:

adb shell pm set-install-location 2

Makes install impossible on many apps that can't install externally (such as adblock + or so)

Then the solution is

adb shell pm set-install-location 0

Or

adb shell pm set-install-location 1

0: auto (if one is full - or irrelevant !!! - it select the other)
1: internal
2: external
路弥 2024-10-19 11:07:05

我写这篇文章感觉有点奇怪,但我不能 100% 确定在某些情况中它是不正确(它对我有用)。如果您有以下症状:

  • 您一直在使用物理设备(在我的例子中是 Samsung Galaxy Ace)工作,
  • 您已经连续开发了几天,
  • 您的手机始终处于连接状态
  • 几天后您开始收到此错误,并且情况变得越来越糟。
  • 其他答案都不适合您
  • 你和我一样听天由命……

那么,试试这个:

  • 不工作时拔掉手机插头!

我拔掉手机插头,让它休息一整天。我的电池有点磨损了。之后我重新连接并再次开始调试。这次一切顺利!我的意思是真的很好,就像以前一样。

此错误是否可能是由于某些电池相关的硬件造成的?这样想仍然感觉很奇怪,但现在我时不时地断开手机连接(并且在晚上)并且问题没有再出现。

I feel a bit weird writing this, but I can't be 100% sure that it's not true in some cases (it worked for me). If you had the following symptoms:

  • You've been working using a physical device (in my case, Samsung Galaxy Ace),
  • You've been developing for a couple of days straight,
  • Your phone was connected all the time, day and night.
  • You started getting this error after a couple of days, and it kept getting worse.
  • None of the other answers worked for you.
  • You're as resigned as I was...

Then, try this:

  • Unplug your phone when you're not working!

I unplugged my phone and let it rest for ENTIRE DAY. My battery wore off a little. After this, I reconnected it and started debugging again. Everything worked fine this time! And I mean really REALLY fine, just as before.

Is it possible that this error might be due to some battery-related hardware stuff? It still feels weird thinking this way, but now I keep disconnecting my phone every now and then (and for the night) and the problem didn't return.

烟沫凡尘 2024-10-19 11:07:05

由于这个问题仍然存在,我想我应该添加一些内容 RacZo 的答案用于开发目的。如果您不使用 Eclipse 插件或出于任何原因不使用有源代码,但只有 .apk,您可以在启动模拟器时使用相同的选项从命令行增加分区大小:

emulator -avd <emulator name> -partition-size 1024

据我所知,此选项没有在developer.android.com上记录,所以我我想我会把它发布在这里,这样人们就可以找到这个解决方案。

As this issue still exists, I thought I'd add something to RacZo's answer for development purposes. If you're not using the Eclipse plugin or for whatever reason you don't have the source, but just the .apk, you can increase the partition size from the command line using the same option when you launch the emulator:

emulator -avd <emulator name> -partition-size 1024

As far as I know, This option is not documented at developer.android.com, so I thought I'd post it here so people might find this solution.

彼岸花ソ最美的依靠 2024-10-19 11:07:05

模拟器解决方案

打开您的.Android 目录。通常在您的主目录中。然后转到 avd,然后打开包含您要更改的 avd 名称的目录。

现在编辑 config.ini 文件并添加以下行或修改以下行:

disk.dataPartition.size=1024

其中 1024 是您想要使用的大小(以 MB 为单位)。保存文件,然后启动模拟器并选中擦除用户数据。您的模拟器现在应该具有新的大小。

Emulator solution

Open your .Android directory. Usually in your home directory. Then go to avd and then open the directory that has the name of the avd you would like to change.

Now edit the config.ini file and add the following line or modify the following line:

disk.dataPartition.size=1024

Where 1024 is the size you would like to use in MB. Save the file and then start your emulator with wipe user data checked. Your emulator should now have the new size.

我的鱼塘能养鲲 2024-10-19 11:07:05

三星 Galaxy Ace 在其规格中宣传 158MB 内部存储,但核心应用程序和服务消耗了大约 110MB(我使用设备上的任务管理器来检查这一点)。我的应用程序有 52MB,因为它有很多资源。当我删除其中一些文件到 45MB 后,该应用程序就成功安装了,没有出现任何问题。该设备仍然提醒我内部存储空间即将满,我应该卸载一些应用程序,即使我只安装了一个应用程序。

安装 .apk 捆绑包的发布版本然后卸载后,我的设备显示 99 MB 的可用空间,因此可能是调试信息弄乱了设备。请参阅Louis Semprini 的回答

Samsung Galaxy Ace advertises 158 MB of internal storage in its specifications, but the core applications and services consume about 110 MB of that (I used the task manager on the device to inspect this). My app was 52 MB, because it had a lot of assets. Once I deleted some of those down to 45 MB, the app managed to install without a problem. The device was still alerting me that internal storage was almost full, and I should uninstall some apps, even though I only had one app installed.

After installing a release version of the .apk bundle and then uninstalling it, my device displays 99 MB of free space, so it might be debugging information cluttering up the device after all. See Louis Semprini's answer.

盗心人 2024-10-19 11:07:05

解决方案很简单。

打开 AVD 管理器。编辑您的 AVD。

在硬件部分下方,列出了一些属性,其右侧列出了“新建...”和“删除”。

按新建。选择数据分区大小。设置为“512MB”(MB 是必需的)。你就完成了。如果仍然遇到问题,请使用相同的方法也增加系统和缓存分区。

这一切都记录在这里:
http://developer.android.com/guide/developing/devices/managing -avds.html

The solution is simple.

Open up the AVD Manager. Edit your AVD.

Down in the hardware section, there are some properties listed with "New..." and "Delete" to the right of it.

Press New. Select Data Partition size. Set to "512MB" (the MB is required). And you're done. if you still get issues, increase your system and cache partitions too using the same method.

It's all documented right here:
http://developer.android.com/guide/developing/devices/managing-avds.html

风吹雨成花 2024-10-19 11:07:05

只需从命令行卸载模拟器中的应用程序或转到设置并卸载应用程序即可。这将阻止错误的发生。

Just uninstall the application from emulator either from command line or go to settings and uninstall the application. This will stop the error from coming.

烟酒忠诚 2024-10-19 11:07:05

我在使用新的 Nexus 4 和使用 Adob​​e AIR 构建的 APK 时遇到了这个问题。我的清单中已经有 android:installLocation="preferExternal" 。我注意到我还使用 -s 选项调用 adb install (在共享大容量存储上安装包,例如 sdcard。)这似乎有点矫枉过正。

adb install 中删除 -s 标志解决了我的问题。

I ran into this problem with my new Nexus 4 and an APK built with Adobe AIR. I already had android:installLocation="preferExternal" in my manifest. I noticed I was also calling adb install with the -s option (Install package on the shared mass storage such as sdcard.) which seemed like overkill.

Removing the -s flag from adb install fixed the issue for me.

卖梦商人 2024-10-19 11:07:05

我遇到这个问题是因为我使用 Sideload Wonder Machine 将应用程序安装到我的实际手机时遇到此错误。我发现问题是 /payload 目录中有多个 .apk 文件。我以为这是受支持的东西,但是当我删除除一个 .apk 之外的所有内容时,错误就消失了。

I came across this question because I was getting this error using the Sideload Wonder Machine to install apps to my actual phone. I found the problem was that I had multiple .apk files in the /payload directory. I thought this was something that was supported, but when I removed all but one .apk, the error went away.

风流物 2024-10-19 11:07:05

确保在尝试运行模拟器时没有将 Android 设备与 USB 连接

Make sure you don't connect your android device with usb while trying to run the emulator

佞臣 2024-10-19 11:07:05

解决方法:

编译为 2.1,不使用 android:installLocation="preferExternal"

好的?

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

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

Workaround:

Compile as 2.1 without android:installLocation="preferExternal".

OK?

Compile as 2.2 including android:installLocation="preferExternal".

This will still install on SDK version less than 8 (the XML tag is ignored).

执着的年纪 2024-10-19 11:07:05

如果您使用的是真实设备,那么您只会耗尽内部内存。只需进入 Android 设置 -> 应用程序,并将某些应用程序移动到SD卡或卸载某些应用程序。

如果您使用的是模拟器,请参阅 RacZo 的回答

If you're using a real device, you've simply run out of internal memory. Just go to Android settings -> Applications, and move some apps to the SD card or uninstall some apps.

If you're using the emulator, see RacZo's answer.

盛夏尉蓝 2024-10-19 11:07:05

当我尝试使用以下命令在 SD 卡 目录中批量安装大约 50 个应用程序时,遇到了同样的错误完整 ROM 更新后的 ADB shell:

for x in *.apk; do pm install -r $x; done

其中一些已安装,但许多都失败并出现错误 INSTALL_FAILED_INSUFFICIENT_STORAGE 。所有失败的应用程序名称中都有空格。我批量重命名它们并再次尝试。这次一切都成功了。我没有做重启或任何事情。可能这不是你们面临的问题,但这可能会帮助那些与我面临同样问题的人。

I came across the same error when I tried to batch install about 50 apps in the SD card directory using the ADB shell after a full ROM update:

for x in *.apk; do pm install -r $x; done

Some of them installed, but many failed with the error INSTALL_FAILED_INSUFFICIENT_STORAGE. All the failed apps had space in their name. I batch renamed them and tried again. It all worked this time. I did not do reboot or anything. May be this is not the problem you guys are facing, but this might help someone searching with the same problem as I faced.

怼怹恏 2024-10-19 11:07:05

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

If you are running your application on an emulator, and if this problem persists, check your notification manager. If it shows you an icon and notification about "Phone memory is full", that means you have already installed so many applications on your emulator. Uninstall several applications which you don't want currently from "Settings >> Manage Application >> Select Application >> Uninstall".
That Set.
Now re-run the program.

舂唻埖巳落 2024-10-19 11:07:05

今天,我在使用手机使用 Eclipse 进行测试/调试时遇到此错误。

我的错误是我在应用程序名称中使用了挪威语特殊字符(“æ”、“ø”、“å”)。当我重构应用程序名称(使用“o”而不是“ø”)时,应用程序已正确安装。

可能不是您的问题,但可能会引起其他人遇到相同错误的注意。

I got this error today, when using my phone for testing/debugging with Eclipse.

My error was that I used Norwegian special character ("æ", "ø", "å") in the application name. When I refactored the app name (using "o" instead of "ø") the app was installed correctly..

Probably not your problem, but could be note for other people getting the same error.

风情万种。 2024-10-19 11:07:05

在尝试了该线程中的其他所有内容后,我发现自己的问题是因为 .apk 文件的路径太长。所以我 cd'ed 到 .apk 所在的目录并执行:

cd /Very/Long/Path/To/Package/
adb install mypackage.apk

而不是

adb install /Very/Long/Path/To/Package/mypackage.apk

And it Works...installed just good。

只是认为这可能对其他人有帮助。

After trying out everything else in this thread, I found out my own problem was because the path to the .apk file was too long. So I cd'ed to the directory where the .apk was in and did:

cd /Very/Long/Path/To/Package/
adb install mypackage.apk

instead of

adb install /Very/Long/Path/To/Package/mypackage.apk

And it worked...installed just fine.

Just thought this might help someone else.

骄兵必败 2024-10-19 11:07:05

就我而言,它是通过增加 eclipse 的扩展内存、更改 eclipse.ini 中的 -Xmx768m 的值来解决的。

In my case it got fixed by increasing the extended memory of eclipse, by changing the value of -Xmx768m in eclipse.ini

骑趴 2024-10-19 11:07:05

我最终从设备上卸载了该应用程序,然后将其重新安装回 Eclipse 中。这是我在经常使用设备时经常遇到的问题,但今天我从开发中收到了该消息。

I ended up uninstalling the app from the device and then re-installing it back in Eclipse. This is a problem I get all the time on my device from regular use, but today I got that message from development.

梨涡少年 2024-10-19 11:07:05

我也遇到了同样的问题,我做了“恢复出厂设置”,之后效果很好。

I too faced the same problem, and I did a "Factory data reset", and it worked fine after that.

紫﹏色ふ单纯 2024-10-19 11:07:05

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

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

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

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

I didn't have root access on my phone and am unprepared for my app to be installed on the SD card. 15 MB of space is available on /data/ and my application is under 2 MB.

For a while I got by; cleaning the Eclipse project and restarting the phone, but eventually that stopped working (probably after an update).

Cleaning my application cache has solved the problem for me and doesn't require a restart of the phone or uninstallation of the app.

There are applications on the market which you can use to clear the cache of multiple applications at once. Search for "clean".

聚集的泪 2024-10-19 11:07:05

有点耗时,但在任何情况下都应该有效:

通过 USB 连接并启用 USB 存储。将 APK 文件从本地版本复制到手机(您可能需要允许应用程序设置下的未知来源)。

然后只需点击 APK 文件,Android 就会安装它。就像我说的,这很耗时,但可能比时不时重新启动要快。

A bit time consuming, but it should work in any case:

Connect via USB and enable USB storage. Copy the APK file from your local build to the phone (you might need to allow unknown sources under application settings).

Then just tap the APK file and Android will install it. Like I said, it's time consuming, but it might be faster than rebooting every now and then.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文