Bila anda mendapati error “No space left on device” di Android Studio selamat! Disini ada solusi atas masalah tersebut. Error tersebut muncul karena folder /tmp tempat menyimpan data sementara Android Studio penuh. Misalkan karena anda mendownload banyak Android images, atau update Android images terbaru
Contoh di komputer saya

Filesystem               Size  Used Avail Use% Mounted on
devtmpfs                 1.9G     0  1.9G   0% /dev
tmpfs                    1.9G   84K  1.9G   1% /dev/shm
tmpfs                    1.9G  1.7M  1.9G   1% /run
tmpfs                    1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/mapper/fedora-root   50G   13G   35G  27% /
tmpfs                    1.9G  1.9G   32K 100% /tmp
/dev/mapper/fedora-home  139G   44G   89G  33% /home
/dev/sda5                477M  150M  298M  34% /boot
tmpfs                    385M   12K  385M   1% /run/user/1000

Error lengkapnya

[1989756]   WARN - ectedPackagesStep$CustomLogger - An error occurred while preparing SDK package Google APIs Intel x86 Atom System Image: No space left on device. 
java.io.IOException: No space left on device
...
[2462931]   WARN - s.RepoProgressIndicatorAdapter - java.io.IOException: Cannot download 'https://dl.google.com/android/repository/repository2-1.xml': No space left on device
, response: 200 OK 
[2463003]   WARN - s.RepoProgressIndicatorAdapter - java.io.IOException: Cannot download 'https://dl.google.com/android/repository/sys-img/android/sys-img2-1.xml': No space left on device
, response: 200 OK 
[2463028]   WARN - s.RepoProgressIndicatorAdapter - java.io.IOException: Cannot download 'https://dl.google.com/android/repository/sys-img/android-wear/sys-img2-1.xml': No space left on device
, response: 200 OK 
[2463058]   WARN - s.RepoProgressIndicatorAdapter - java.io.IOException: Cannot download 'https://dl.google.com/android/repository/sys-img/android-tv/sys-img2-1.xml': No space left on device
, response: 200 OK 
[2463086]   WARN - s.RepoProgressIndicatorAdapter - java.io.IOException: Cannot download 'https://dl.google.com/android/repository/sys-img/google_apis/sys-img2-1.xml': No space left on device
, response: 200 OK 
...

Solusi

Karena kadang update images Android mencapai 2 GB, belum termasuk waktu di un-compress, maka saya membuat satu folder untuk menyimpan semua cache file Android Studio, foldernya berada di /home/tommy/androidstudiotmp. Buka file studio.sh, di komputer saya /home/tommy/android-studio/bin/studio.sh

VM_OPTIONS=""

menjadi

VM_OPTIONS="-Djava.io.tmpdir=/home/tommy/androidstudiotmp"

tutup Android Studio, hapus isi folder /tmp

rm -fr /tmp/*

buka kembali Android Studio, masalah No space left on device pun tinggal kenangan.

Leave a comment

Your email address will not be published. Required fields are marked *