简体   繁体   中英

Android Studio 2.1 Preview1 Gives No space left on device Error

I updated my android studio to 2.1 preview version, after that it's giving No space left on device Error. How to resolve this issue?

For me, this was due to my /tmp partition being too small . I got these errors both when trying to install a large device image (Android 7.1) and when trying to start an AVD. It seems that Android Studio will try to unzip big files in /tmp.

To increase the size of /tmp on Linux, set the size= parameter in /etc/fstab, eg on my Ubuntu I now have:

tmpfs /tmp tmpfs defaults,size=3g 0 0

A reboot is needed to apply that change.

Note that tmpfs is entirely held in RAM so you should probably undo this change after the installation of these components.

TL;DR (This happens if there is no free space in /tmp )

To increase the size of /tmp just type the below command in terminal

$ sudo mount -o remount,size=8G /tmp/

PS:- 8G is an arbitary value, you can set it to any size as far as its enough to done the job.

You can get rid of this error by restarting Android studio/your system .

To solve this issue, do not update your SDK directly from popup you get when there is any update available, instead
Goto -> SDK Platforms window,

or Goto File->Settings->Appearance and Behavior->System Settings->Android SDK

In that opened window you will see Launch Standalone SDK Manager

Click on that it will open another window,update your SDK from there.

You can also solve this by using TMPDIR=pathtodirectorytobeusedastmp before launching studio.sh from terminal.

eg: TMPDIR=/HOME/user/downloads studio.sh

PS This only applies if you are using any of the linux distributions.

What device are we talking about here? Is this for your emulator?

If so, try the following methods:

  1. Try clearing the cache on the device. Cache storage can take up some unneeded space, especially on an emulator device.

  2. In a console window, type the following commands.

    android list avd

    emulator -avd My_Avd_Name -wipe-data

What this will do is wipe the data for the emulator you choose to clear.

  1. Create a new virtual device, and allocate more space to it. I'm not sure if you can edit your existing one add just add more space to it or not.

Resources:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM