2

I kept getting the

No space left on the device

error message while trying to run an Android project from my Xamarin.Forms solution. Here is the error message below. This works with a physical device, but not with Emulator. Is there anything I can try?

Detecting installed packages
    Target device is x86.
    Installing the Mono shared runtime (debug - 1503094152)...
    10% ... 3520kb of 35036kb copied
    20% ... 7040kb of 35036kb copied
Installing shared runtime
    30% ... 10560kb of 35036kb copied
    40% ... 14016kb of 35036kb copied
    50% ... 17536kb of 35036kb copied
    60% ... 21056kb of 35036kb copied
    70% ... 24576kb of 35036kb copied
    80% ... 28032kb of 35036kb copied
    90% ... 31552kb of 35036kb copied
     Deployment failed
    Mono.AndroidTools.AdbException: No space left on device
      at Mono.AndroidTools.Util.AggregateAsyncResult.CheckError (System.Threading.CancellationToken token) [0x0002a] in /Users/builder/data/lanes/4986/28510831/source/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Util/AggregateAsyncResult.cs:72 
      at Mono.AndroidTools.Adb.AdbSyncClient.EndPush (System.IAsyncResult result) [0x00006] in /Users/builder/data/lanes/4986/28510831/source/monodroid/tools/msbuild/external/androidtools/Mono.AndroidTools/Adb/AdbSyncClient.cs:771 
      at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x0000f] in /private/tmp/source-mono-d15-3/bockbuild-d15-3/profiles/mono-mac-xamarin/build-root/mono-x64/mcs/class/referencesource/mscorlib/system/threading/Tasks/FutureFactory.cs:550 
    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(516,2): error : No space left on device
    Touching "obj/Debug/upload.flag".
Done building target "_Upload" in project "Articles.Droid.csproj".

Done building project "Articles.Droid.csproj".
Build succeeded.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.Debugging.targets(516,2): error : No space left on device
    0 Warning(s)
    1 Error(s)
testing
  • 19,681
  • 50
  • 236
  • 417
Baba
  • 2,059
  • 8
  • 48
  • 81
  • 1
    have you tried increasing the available space in your emulator image? – Jason Sep 03 '17 at 22:27
  • Not sure how to do that. I am very new with xamarin.forms – Baba Sep 03 '17 at 22:51
  • 1
    Possible duplicate of [How to increase storage for Android Emulator? (INSTALL\_FAILED\_INSUFFICIENT\_STORAGE)](https://stackoverflow.com/questions/2239330/how-to-increase-storage-for-android-emulator-install-failed-insufficient-stora) – Jason Sep 03 '17 at 22:59
  • it has nothing to do with XF. It's purely a function of the Emulator, which is a Google app. There are numerous posts on SO and elsewhere on the web that explain how to do this. – Jason Sep 03 '17 at 22:59
  • By the way, I am using visual studio for mac not eclipse. – Baba Sep 03 '17 at 23:07
  • all of the Android tools are provided by Google, just like all of the iOS tools are provided by Apple – Jason Sep 03 '17 at 23:11

1 Answers1

2

Go to your terminal and type:

$ [[path-to-android-sdk]]/tools/android list avd

This will show you a window with all the AVDs (Android Virtual Devices) you have configured. Find the one you’re using and write down its name.

Next, go back to your terminal and type:

$ open -a TextEdit ~/.android/avd/[[name of your avd]].avd/config.ini

This opens TextEdit with the AVD’s configuration file. Now look for and change or add this line:

data.dataPartition.size=2048m

Next, go back to your terminal and type:

$ open -a TextEdit ~/.android/avd/[[name of your avd]].avd/hardware-qemu.ini

This opens the TextEdit again with the Hardware’s configuration file. Now look for and change or add this line:

data.dataPartition.size=2048m

Then click "Factory Reset" in the Device Manager. Then boot the emulator up and it found the correct storage size.

And that’s it. You’re set!

Jader Oliveira
  • 331
  • 1
  • 8
  • It looks that it is not working with values other than 2048m – scar80 Jan 09 '19 at 12:19
  • I tried to increase the size, and worked properly. Also, Google says: "Data partition size – Specifies the size of the user data partition in bytes. If this value is an integer, it specifies the size in bytes. You can also specify the size in kilobytes, megabytes, and gigabytes by appending K, M, or G to the value. The minimum size is 9M and the maximum size is 1023G." https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/device-properties?pivots=windows – Jader Oliveira Mar 15 '19 at 09:13
  • 1
    So I opened Android Device Manager (via VS), selected the device with partition size issues, pressed Edit, I looked for the property "disk.dataPartition.size", and then I set the value for "4096M". (if you dont find the property, you can add it). Save changes, run Android Emulator and check the storage size. – Jader Oliveira Mar 15 '19 at 09:16