Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't start emulator environment (error NAND: could not write file...file exists)

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

like image 786
John Curwood Avatar asked Jul 13 '12 21:07

John Curwood


2 Answers

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

like image 189
user212297 Avatar answered Nov 12 '22 11:11

user212297


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

like image 23
user7610 Avatar answered Nov 12 '22 11:11

user7610