Android Studio AVD Manager Create AVD in Root Directory
I am using Android Studio with Ubuntu and it will not create AVDs. Nothing gets created in my ~ / .android / avd directory. Instead, things get created in my / root directory. Which I think I wouldn't care, except that it can't start the emulator for these AVDs if the AVDs are in my root folder. I think because to access the Android SDK manager on Linux, Android Studio needs to be run with sudo ... but then it puts the AVD in the root system instead of at home ...
I have a few photos outlining this problem very clearly, but stackoverflow won't even let me link to them without 10 rep, which is a limitation hindrance.
EDIT: Here is the error I get in my terminal when I try to execute an android bash script located at
. This is the same error whether Android Studio is open or not.
ss108 tools$ bash android java.lang.NullPointerException at java.io.File.<init>(File.java:277) at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1516) at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1492) at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:346) at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:369) at com.android.sdklib.internal.repository.updater.UpdaterData.initSdk(UpdaterData.java:252) at com.android.sdklib.internal.repository.updater.UpdaterData.<init>(UpdaterData.java:120) at com.android.sdkuilib.internal.repository.SwtUpdaterData.<init>(SwtUpdaterData.java:61) at com.android.sdkuilib.internal.repository.ui.SdkUpdaterWindowImpl2.<init>(SdkUpdaterWindowImpl2.java:104) at com.android.sdkuilib.repository.SdkUpdaterWindow.<init>(SdkUpdaterWindow.java:88) at com.android.sdkmanager.Main.showSdkManagerWindow(Main.java:407) at com.android.sdkmanager.Main.doAction(Main.java:390) at com.android.sdkmanager.Main.run(Main.java:150) at com.android.sdkmanager.Main.main(Main.java:116)
source to share
AVDs are created underneath
because you run Android Studio with
. You need to configure the permissions so that this is not required The simplest solution I have found is to install Android Studio and Android SDK as a regular user. I set them to
so I don't have to worry about permission issues at all. When everything is set up, my normal user account has permission to execute all the files I need.
Alternatively, you can use
(either manually or with
) to set Android Studio and Android SDK file permissions.
source to share