How to increase storage for Android Emulator? (INSTALL_FAILED_INSUFFICIENT_STORAGE)
Asked Answered
K

24

228

I get this sometimes(not often) for one of my projects, couple of classes only
Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE

How do I increase emulator's storage?

Koffler answered 10/2, 2010 at 18:26 Comment(2)
I see this error quite often, even when the device being installed to has plenty of storage. Just keep in mind that sometimes when you see the error, what the error message says isn't actually true.Crassus
@Pentinum10 i am getting the same error on both 1.5 and 2.2 , checkout this question where your help required: #3584797 , please help me and catch me outPointed
J
140

Update

This answer is, as I write this, nearly eight years old, and about five years stale. But it's still (as I write this) the "accepted" answer, because it answered the question when it was asked.

The newer answer, that applies to the newer Android Studio tools, can be found here: https://mcmap.net/q/66269/-how-to-increase-storage-for-android-emulator-install_failed_insufficient_storage -- it's a great answer with screen shots. If you're using Android Studio, ignore the Eclipse answer below.

Original Eclipse-based Answer

I was searching for the answer to this question, and was unsatisfied with the above answers. But then I found the answer, so here it is for future reference:

To summarize (and clarify), in Eclipse, go to "Debug Configurations". You can find that in the drop-down under the "debug" icon. Select "target", and select a preferred emulator target to launch. Then under "additional emulator command line options," add this:

-partition-size 1024

Then CLOSE the emulator (and remove any devices), and click the debug icon, which will launch the preferred emulator you selected. This is important: Eclipse needs to launch the debugger, not AVD.

That fixed the problem for me.

Janellejanene answered 15/10, 2010 at 20:33 Comment(8)
Note that the "partition-size" is in megabytes, and that generally to install an APK you need at least twice as much disk space as the size of the APK.Mccrae
Another note to make: You must right click on the project you want to run in eclipse -> Run->Run Configuration->Select Project->Target ->scroll down->add -partition-size 1024 to additional Em options-> then run the project from eclipseAnestassia
You gave the solution for Eclipse, but the question was not about a particular emulator.Escrow
@Escrow I gave the solution for Eclipse because that was the predominant development environment in use at the time (five years ago!). The -partition-size option is an emulator option, so find out how to add the option to whatever IDE you ARE using, or alternately, launch the emulator from the command line yourself.Janellejanene
For anyone looking at this accepted answer years later like I did, you probably want to look at https://mcmap.net/q/66269/-how-to-increase-storage-for-android-emulator-install_failed_insufficient_storage instead.Felsite
-partition-size: invalid optionProcambium
@Procambium Look at the other answers. This one is at least 5 years stale.Janellejanene
I disagree that this should be accepted because it answered the question at the time. If someone opened a new question asking the same thing now, it would be closed as a duplicate. The accepted answer should reflect the answer to the question now, not when it was askedDerosier
B
228

On Android Studio

Open the AVD Manager.

enter image description here

Click Edit Icon to edit the AVD.

enter image description here

Click Show Advanced settings.

enter image description here

Change the Internal Storage, Ram, SD Card size as necessary. Click Finish.

enter image description here

Confirm the popup by clicking yes.

enter image description here

Wipe Data on the AVD and confirm the popup by clicking yes.

enter image description here

Important: After increasing the size, if it doesn't automatically ask you to wipe data, you have to do it manually by opening the AVD's pull-down menu and choosing Wipe Data.

enter image description here

Now start and use your Emulator with increased storage.

Boisterous answered 6/3, 2016 at 14:25 Comment(11)
Changing "Internal Storage" does nothing for me, before or after creating the AVD. It always comes up with 300MB and a low space warning.Peacemaker
Have you wiped the data from drop down menu in AVD manager once you changed the size.Boisterous
I already deleted the AVD, but it was happening with newly configured un-launched images too. I found in another question that it's an issue with certain APIs <23.Peacemaker
OMG - thank you for this! It's the only solution that I found that worked!Shirker
This should be the accepted answer, and the first to appear (not legacy Eclipse related answers). It's not enough to change the size and start the emulator (even when using Cold Boot Now). The key seems to be the Wipe Data command. Thanks!Undone
For anyone who can't find the Wipe Data on newer AVD versions, you'll see it after you click the down arrow in the Actions column in AVD. I didn't get an automatic prompt to wipe data when changing the internal storage only.Felsite
I added a step to the answer to manually wipe data if it doesn't ask you automatically. Thanks @Boisterous for the answer and to all for the helpful comments.Jaunitajaunt
I changed internal, RAM and heap storage but I was forced to invalid cache and restart to take effect.Michaelmas
Wipe data is very important step, still in 2022 with BumblebeeTuesday
I have broken my head, when I tried to find the "Memory and storage" part in the Advanced settings :)) I had to scroll down to see the settings!Maggee
Yes. There is no visible scroll bar but you can scroll after clicking after settings!Noddy
J
140

Update

This answer is, as I write this, nearly eight years old, and about five years stale. But it's still (as I write this) the "accepted" answer, because it answered the question when it was asked.

The newer answer, that applies to the newer Android Studio tools, can be found here: https://mcmap.net/q/66269/-how-to-increase-storage-for-android-emulator-install_failed_insufficient_storage -- it's a great answer with screen shots. If you're using Android Studio, ignore the Eclipse answer below.

Original Eclipse-based Answer

I was searching for the answer to this question, and was unsatisfied with the above answers. But then I found the answer, so here it is for future reference:

To summarize (and clarify), in Eclipse, go to "Debug Configurations". You can find that in the drop-down under the "debug" icon. Select "target", and select a preferred emulator target to launch. Then under "additional emulator command line options," add this:

-partition-size 1024

Then CLOSE the emulator (and remove any devices), and click the debug icon, which will launch the preferred emulator you selected. This is important: Eclipse needs to launch the debugger, not AVD.

That fixed the problem for me.

Janellejanene answered 15/10, 2010 at 20:33 Comment(8)
Note that the "partition-size" is in megabytes, and that generally to install an APK you need at least twice as much disk space as the size of the APK.Mccrae
Another note to make: You must right click on the project you want to run in eclipse -> Run->Run Configuration->Select Project->Target ->scroll down->add -partition-size 1024 to additional Em options-> then run the project from eclipseAnestassia
You gave the solution for Eclipse, but the question was not about a particular emulator.Escrow
@Escrow I gave the solution for Eclipse because that was the predominant development environment in use at the time (five years ago!). The -partition-size option is an emulator option, so find out how to add the option to whatever IDE you ARE using, or alternately, launch the emulator from the command line yourself.Janellejanene
For anyone looking at this accepted answer years later like I did, you probably want to look at https://mcmap.net/q/66269/-how-to-increase-storage-for-android-emulator-install_failed_insufficient_storage instead.Felsite
-partition-size: invalid optionProcambium
@Procambium Look at the other answers. This one is at least 5 years stale.Janellejanene
I disagree that this should be accepted because it answered the question at the time. If someone opened a new question asking the same thing now, it would be closed as a duplicate. The accepted answer should reflect the answer to the question now, not when it was askedDerosier
I
48

Add the following to the avd config.ini

disk.dataPartition.size=1024MB

Let me know if this works for you also.

I added in the line Add Data Partition Size Configuration
Screen Shot of AVD Storage Space being increased

Instable answered 16/12, 2011 at 13:57 Comment(3)
Didn't work for me on a 2.3 image. I still only see 128MB of internal storage available for apps.Faubion
I noticed that in the "Edit" UI of AVD Manager, trying to set this value manually will always reset it to 0. Perhaps a related issue? Maybe it's not supposed to be set on some versions of Android?Faubion
You have to enter a value like, 1024MB when using the AVD Manager. You can't just enter 1024 Took a little while to figure that out, and I have confirmed this worksIgnace
N
28

Run AVD Manager

Select your AVD and click "Details..." button.

In my case AVD Manager sets disk size as

disk.dataPartition.size=4000M

This invalid value, disk is approx 500MB despite numbers specified.

Go to AVR's folder by path in "AVD details".

Edit it in config.ini to

disk.dataPartition.size=4000MB

and remove all .img files.

Neoma answered 22/11, 2017 at 11:37 Comment(6)
This should be the selected answer. On current versions of Android Studio (3.0.1), the edit settings properties are grayed out if you are running a Google Play enabled AVD. This worked. I changed my test device to 2000MB from the 400M, deleted all *.img and *.qcow2 files. Wiped data on the AVD. Then booted it up, and it had 2000 MB of storage.Reno
@Reno I agreeCaptivate
Just FYI, I didn't have to delete *.img or any other file. Just changing value in config.ini was enough.Tlemcen
Thanks! Worked for my case.Unmitigated
M -> MB is the fix .. thanks to bring that outSwihart
The year is 2023 and AVD manager still has this bug.Yolandayolande
T
17

Just start emulator by command line as follow:

emulator -avd <your avd name> -partition-size 1024 -wipe-data
Tripinnate answered 2/4, 2012 at 6:27 Comment(1)
Thanks , I was facing the same problem. It is working for me now.Sparid
M
10

I was doing an install of an apk:

adb install /home/me/jones_android-arm.apk

And I was getting an error message telling me that

/data/local/tmp/jones_android-arm.apk

was too big. Using the sdk tools from r15, and ADT 15 I was able to use the AVD manager to manipulate some of my existing emulator's settings:

Window-> AVD Manager -> (select you virtual machine) -> Edit

then going to the Hardware properties window just below "Skin:" I was able to select with the Hardware: New button 'Ideal size of partition'. I was not, however, able to set the value other than to '0'. Undaunted, I went to my ${HOME}/.android/avd directory There was a 'MyVm.avd' directory. Going into that directory I found a 'config.ini' file. There was the entry :

disk.dataPartition.size=0

I set this to:

disk.dataPartition.size=1024

.. then went back to the AVD Manager, selected MyVm, selected 'Start', opted to wipe user data win the dialog following, and was able to run and install.

Marmawke answered 9/11, 2011 at 23:33 Comment(1)
It worked last time fine but today I had to write disk.dataPartition.size=1024MB, since 1024 and 1024m weren't working.French
C
6

avd manager has an option "ideal size of system partition", try setting that to 1024MB, or use the commandline launch option that does the same.

fyi, I only encountered this problem with the 4.0 emulator image.

Copenhaver answered 26/10, 2011 at 13:6 Comment(1)
Same here. When you do that make sure to restart the emulator from a clean state and NOT from a snapshot.Enchanting
E
6

If you have the M1 Mac and the preview version of Android Emulator, then you'll need to go to /Applications/Android Emulator.app/Contents/MacOS/api30-gphone-arm64-v8a/config.ini (as an example) and change the disk.dataPartition.size property to your desired size.

something like this: enter image description here

The reference is in the GitHub repo.

Best regards.

Educative answered 5/11, 2021 at 22:13 Comment(2)
No such file(s) exists despite having several emulators installed (M1 Pro Macbook). Only file in /Applications/Android Studio.app/Contents/MacOS/ is the studio binary.Rakeoff
Hello @Rakeoff This was only for the preview emulator. Now you can create arm64-v8a emulators from Android Studio without any problem in an M1 :)Educative
I
4

this problem comes with android 1.5 .. try 2.0 or 2.1 or 2.2

Infinitesimal answered 22/2, 2010 at 10:1 Comment(2)
I'm getting this with 2.2 on my N1Centaur
i am getting on both 1.5 and 2.2 #3584797Pointed
L
4

you need to increase virtual memory of emulator

How to increase virtual memory of emulator

emulator -avd "Emulator Name" -partition-size 2024

after then try to install your apk

Liverpool answered 29/11, 2012 at 7:9 Comment(0)
B
4

To resize the storage of the Android emulator in Linux:

1) install qemu

2) Locate the directory containing the img files of the virtual machine. Something like ~/.android/avd/.avd and cd to it.

3) Resize the ext4 images: i.e. for growing from 500Mb to 4Gb execute

qemu-img resize userdata.img +3.5GB
qemu-img resize userdata-qemu.img +3.5GB

4) grow the filesystem:

e2fsck -f userdata.img
resize2fs userdata.img
e2fsck -f userdata-qemu.img
resize2fs userdata-qemu.img

5) For the sd card image, optional: rescue the data:

mkdir 1
mount -o loop sdcard.img 1
cp -a 1 2
umount 1

6) resize the image from 100Mb to Gb:

qemu-img resize sdcard.img +3.9GB

7) re-generate the filesystem:

mkfs.vfat sdcard.img

8) optional: restore the old data:

mount -o loop sdcard.img 1
cp -a 2/* 1
mount -o loop sdcard.img 1 
Bhayani answered 12/2, 2016 at 13:19 Comment(0)
R
3
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.junkfoodian"
android:installLocation="preferExternal"   // this line can work for  Installation error:            //                                             // INSTALL_FAILED_INSUFFICIENT_STORAGE
Retribution answered 31/12, 2011 at 6:11 Comment(1)
Not sure why this was voted down - worked for me so have an up vote. :)Hendrika
D
2

I'm a beginner, but I had that problem while playing around with the "Hello Grid View". I was trying to use my own photos, which were all very large in file size.

The quick fix was to reduce the number of photos, thus reducing the size of the APK file.

But, I guess my follow up question for anybody else who hits this thread is this: How do I attach large files like JPGs and MP3s to an app and make sure they save on the SD Card so the APK remains small?

Dropping answered 20/2, 2010 at 13:0 Comment(1)
I think I found the answer here: developer.android.com/guide/topics/resources/index.html Try using "assets" instead of "resources" for any large elements. From the page: Resources are an integral part of an Android application. In general, these are external elements that you want to include and reference within your application, like images, audio, video, text strings, layouts, themes, etc. Every Android application contains a directory for resources (res/) and a directory for assets (assets/).Dropping
L
2

Update your settings in AVD Manager and start the device by enabling 'Wipe user data'. This worked for me.

Lashay answered 19/12, 2014 at 9:44 Comment(1)
In the new AVD interface, right-click on emulator line, then select wipe user data after you change the internal storage.Middlings
I
1

I guess you should restart the emulator with "emulator -wipe-data -avd YourAvdName" or check "Wipe User Data" in run configuration if you are using Eclipse.

Idiotism answered 28/4, 2010 at 13:43 Comment(0)
I
0

The only time I've seen this happen it was when the host filesystem was basically out of space. Do you have much free space on the filesystem where the VM's filesystem is stored?

Improbability answered 10/2, 2010 at 20:41 Comment(1)
I have plenty of space on my hard disks 13GB free.Koffler
T
0

It is defenetly not a appropriate answer, but it is a small hint.

If you want to make use of static files in your App. You should put them as resources or as assets. But, if U have memory concerns like to keep your APK small, then you need to change your App design in such a way that,

instead of putting them as resources, while running your App(after installation) you can take the files(defenately different files as user may not keep files what you need) from SD Card. For this U can use ContentResolver to take audio, Image files on user selection.

With this you can give the user another feature like he can load audio/image files to the app on his own choice.

Triviality answered 25/2, 2010 at 3:0 Comment(0)
L
0

you can start the one when selecting one item from the left tree "virtual device" in AVD manager dialog on the platform of eclipse, the start UI has the option "Wipe User Data"

Laggard answered 3/6, 2010 at 2:25 Comment(0)
E
0

The following approach worked for me

  1. Navigate to your android SDK/tools folder in the terminal window (in case you didn't added the path for it)

  2. Make sure the virtual device you're planning to clean is powered off.

  3. Run the command "./emulator -wipe-data -avd YourAvdName" where YourAvdName is the name of your virtual android device

Exemplification answered 16/6, 2010 at 11:40 Comment(0)
E
0

I am using VSCode and my AVD setup is from an older Android Studio setup that I had not used for a while.

I was able to fix this issue by finding the location where the AVD Images are located and then searching for files that had the text

disk.dataPartition.size

Run a find . -name "avd*" and a grep "disk" * once you find the directory for the AVD.

Modifying the disk.dataPartition.size value in the hardware-qemu.ini file worked for me.

Equality answered 11/3, 2021 at 8:45 Comment(0)
S
0

The problem can be solved by changing your partition size of emulator.

Go to the your \Android\Sdk\emulator path and type the following command.

emulator -avd android_emulator_name -partition-size 1500 -wipe-data

Now it will work , you have increased the size of your partition size. You can observe the change in size by using the following command before and after running the above command.

adb shell df
Sparid answered 22/9, 2021 at 11:50 Comment(0)
U
0

I'm using bitrise and I increased internal space by passing the parameter '-partition-size 2047' in the AVD step (only if you're using cli)

Example:

/home/user/Android/Sdk/emulator/emulator "@Pixel_6_API_31" "-verbose" "-show-kernel" "-no-audio" "-netdelay" "none" "-no-snapshot" "-wipe-data" "-gpu" "auto" "-no-window" "-no-boot-anim" "-camera-back" "none" "-camera-front" "none" "-partition-size" "2047"

Unship answered 6/2, 2023 at 13:9 Comment(0)
S
0

Edit config.ini under the {name}.avd folder. In windows, it's like C:\Users\{user}\.android\avd\Pixel_3a_API_34_extension_level_7_x86_64.avd\config.ini,

Then change,

disk.dataPartition.size = 8GB

to,

disk.dataPartition.size = 20GB

Finally, restart the emulator by wiping existing user data,

emulator.exe -avd Pixel_3a_API_34_extension_level_7_x86_64 -wipe-data

Don't wipe data later if you want to reuse it.

Selfaddressed answered 19/9, 2023 at 3:13 Comment(0)
H
-3

Try choosing project -> clean. A simple clean may fix it up.

Hammertoe answered 5/1, 2011 at 15:33 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.