Download Failed Because The External Storage Is Full

My app needs to write data into files (should be user-accessible).Now I usually check whether external storage is available/writable or not.If it's available & writable, app would be able to save data to external storage.It at all, the external storage is not available, what should be my next option to write/store data that user can access easily. (writing data into internal storage might be frustrating for the user to search).help please.

You can use Windows Defender or third party anti-virus software to do a full scan of your computer. If after all these steps and you still cannot initialize your external hard drive, it is possibly because the drive have some bad sectors or it is physically broken. The problem external hard drive not initialized can be resolved by using. Download EaseUS hard drive recovery software. On your PC or other external storage devices. To help you repair failed, not working external hard drive.

AnishAnish

1 Answer

If the external storage is unavailable and you want the data to be user accessible, then you should show a dialog informing the user that he/she should make the external storage accessible (putting in an SD Card or disconnecting from the computer, whatever is required). For small files, you could maybe try asking the user and uploading them to his/her dropbox or Google Drive or some other cloud storage accounts.

Full version of game includes alternate galactic travel location of Yavin 4 - not included in original Xbox version. Most of the bugs and glitches from the original.

Also, keep in mind, that as Budius said in the comments, all devices wil have an external storage, even if it isn't available at the moment. This is not completely true though. All device which have been verified by Google and have Google Play will have an external storage. Devices running custom hardware and modified versions of Android may not.

Raghav SoodRaghav Sood

Not the answer you're looking for? Browse other questions tagged androidandroid-sdcard or ask your own question.

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.

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.

For example:

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.


closed as too broad by animusonJun 16 '14 at 16:37

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

31 Answers

12 next

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 worktrying to figure it out from the AOSP source. I have found a REAL solution.

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/-1.apk (1.apk)

When the app is to be updated:

  1. The updated APK file is saved as:

    /data/app/-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.

Run:

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

  • 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


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.


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

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.


The following helps:

  • Open a shell to the device

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

  • List the available files and delete as desired

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.


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


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,


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

For example,

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

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,


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

Too low free space on /data

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.

Disk was cleared and app installed successfully.


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.


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

Symptom : Some app don't install, saying there is no spaceand 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:

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

Then the solution is

Or


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.


In Eclipse,

Run -- > Debug Configurations --> Select 'target', and select a preferred emulator target to launch.

Then Below that 'additional emulator command line options,' add this:

-partition-size 1024

Then CLOSE the emulator and click the debug icon, which will launch the preferred emulator you selected.

Hope it Helps...!


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.


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:

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.


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.


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.


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.


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:

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.


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.


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.


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


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


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.


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.

External Storage Devices Including


2018

Download Failed Because The External Storage Is Full Version

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:

instead of

And it worked...installed just fine.

Just thought this might help someone else.

Download Failed Because The External Storage Is Full Pes 2018


Cara Mengatasi Download Failed Because The External Storage Is Full Pubg

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


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.


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


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


Pubg Mobile Download Failed Because The External Storage Is Full Hatasi

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.

Download Failed Because The External Storage Is Full Free Fire

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


12 next

Not the answer you're looking for? Browse other questions tagged androidinstallationandroid-sdcard or ask your own question.