11

I'm trying to start developing in android but have had problems setting up the development environment: I am running Ubuntu 11.04 and have installed Eclipse Juno 4.2.0. and have updated the android sdk tools to the latest version.

When I try to run an android emulator I get the error "NAND: Could not write file...file exists". When searching on this error on answer said I needed to free up some space on my hard drive. I have since freed up a few Gig from the hard drive but I still get the same error. Another site said to delete all emulator environments and create new ones from scratch. I tried this but when I had just one environment listed in the avd manager and I try to delete it, and error message pops up that says I can't because the emulator is currently running. Even when I reboot the computer, open the avd manager and try to delete I still get the same error. I have tried

adb devices to find the device that is running but no devices get listed.

I get this error whether I am running the avd manager form Eclipse or from the command line. Does anyone know Why I am getting the NAND: Could not write file...file exists error or why I always get the message about the emulator running.

Regards,

John

John Curwood
  • 111
  • 1
  • 4

2 Answers2

12

Try to check the free space on your hard drive....... its usually due to low storage space

user212297
  • 131
  • 1
  • 4
  • Please include references. If you say "usually" there must be other reports / solutions you can link to. – Max Leske Nov 21 '13 at 07:00
  • possible /tmp is full but /home/* is the big secondary disk, example: android studio on centos, debian, suse, etc. rm -rf /tmp/android-$USER && mkdir -p /home/$USER/android-tmp && ln -s /home/$USER/android-tmp android-$USER – e-info128 Dec 08 '15 at 19:13
  • This was the case for me on Ubuntu, /tmp/ was 69% full with 330Mb left. Removing a large directory I dumped there earlier let the emulator start fine. – Neek Feb 24 '16 at 08:44
  • Same problem and solution for me. If the message was not `file exists`, this stackoverflow question would not need to exist... – ibizaman Sep 15 '16 at 15:05
3

Try running df -h repeatedly while the emulator is starting up. You may see something like this:

$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
tmpfs                  3.7G  2.7G  1.1G  72% /tmp
...

$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
tmpfs                  3.7G  3.6G  191M  95% /tmp
...

$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
tmpfs                  3.7G  3.6G  160M  96% /tmp
...

$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
tmpfs                  3.7G  3.6G  112M  98% /tmp
...

$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
tmpfs                  3.7G  3.7G  8.8M 100% /tmp
...

$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
tmpfs                  3.7G  2.7G  1.1G  72% /tmp
...

That is, the partition fills up, then you get the error message and then the partition frees up.

Solution would be either to remount the tmpfs at /tmp with a larger space allocation, 5 GB should be enough, using sudo mount -o remount,size=5G tmpfs /tmp/ or to tell AVD to put its temp directory somewhere else as per How to change the Android emulator temporary directory and https://code.google.com/p/android/issues/detail?id=15716

user7610
  • 25,267
  • 15
  • 124
  • 150