"There is not enough storage space on the device to store package" when starting Android emulator

16,937

Solution 1

Check the internal storage size and available storage of your emulator. Default configuration is often not very large.

Solution 2

On MAC if your getting error make sure you increase your dataPartition to 1024M

disk.dataPartition.size : 1024M

On Mac current config: Feel free to add more bytes if you have a better potato(MacBook pro) than mine

android emulator config on mac

Solution 3

Emulator memory issue

increase heap size ( make it 2*x). in my case before it was 256 , then after i made it 512 , now its working fine.

posted by venkat Yanamandala

Share:
16,937
Xavier Peña
Author by

Xavier Peña

Updated on June 15, 2022

Comments

  • Xavier Peña
    Xavier Peña about 2 years

    I have just updated Xamarin in Visual Studio 2015 (it was a suggested update from Visual Studio).

    After the update, when I start debugging with the emulator AVD_GalaxyNexus_ToolsForApacheCordova (Android 4.4 - API 19), the following error occurs:

    The "InstallPackageAssemblies" task failed unexpectedly.

    System.AggregateException: One or more errors occurred. ---> Xamarin.AndroidTools.AndroidDeploymentException: InternalError ---> Mono.AndroidTools.InsufficientSpaceException: There is not enough storage space on the device to store package: /data/local/tmp/Mono.Android.Platform.ApiLevel_23.apk. Free up some space or use an SD card and try again.

    This did not occur just minutes before the update, and the project remained untouched during the update. I am quite sure about that.

    The Xamarin documentation has this error documented here, and says:

    There is not enough storage space on the device to deploy the package

    This occurs when you don't start the emulator from within Visual Studio. When starting the emulator outside of Visual Studio, you need to pass the -partition-size 512 options, e.g.

    emulator -partition-size 512 -avd MonoDroid

    But I did start the emulator from within Visual Studio.

  • Xavier Peña
    Xavier Peña about 8 years
    I'll post it here again just in case: to change this parameter, go to Visual Studio 2015 -> Open Android Emulator Manager (AVD) -> Edit -> Internal Storage. Also, option B is get rid of previous deployments in the emulator (they are saved in the emulator and they take some space. I didn't know about that.).
  • Dennis Schröer
    Dennis Schröer about 6 years
    @XavierPeña how can one delete previous deployments? I keep getting this error after I deployed my times several times. If I check the device, it shows more than enough place is free, but for some reason I still get this error.
  • Cobus Kruger
    Cobus Kruger about 6 years
    The simplest way to get rid of old deployments is to click the little down-pointing menu for your emulator and choosing Wipe Data. That will get rid of everything though, so I guess a better way is to setup the emulator with your account and so on and then duplicate it. Run the duplicate and use the original as your template. It's strange that you get this though - I have 1GB allocated to internal storage and don't run into this at all.
  • Dennis Schröer
    Dennis Schröer about 6 years
    @CobusKruger Same for me, 1GB storage and it says not even half of it is used. Will update my answer if I find a better solution.
  • Nick Turner
    Nick Turner over 5 years
    I find taking down both the emulator and the manager and bringing it back up fixes the issue. If not adb kill-server/start-server does the trick
  • Philip
    Philip about 4 years
    I had 4GB on my Android emulator of Android Q (system files) was taking up 3.3GB