An error occurred while creating the AVD. See idea.log for details. ubuntu 16.04
Asked Answered
S

4

8

I followed the the link below, to create a android virtual device(AVD).

https://developer.android.com/studio/run/managing-avds.html

As soon as I click on finish button, it gives me the following error:

An error occurred while creating the AVD. See idea.log for details. As I can see last line gives access denied error. Is it requireing the permissions to the .android folder? When I try to give permissions to .android folder, It doesn't allow me. It says

chmod: cannot access '777': No such file or directory

some last lines of idea.log file are

idea.log

2018-01-11 13:00:17,173 [d thread 4]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 86ms; general responsiveness: ok; EDT responsiveness: ok 
2018-01-11 13:00:18,629 [d thread 1]   INFO - .script.IdeScriptEngineManager - javax.script.ScriptEngineManager initialized in 72 ms 
2018-01-11 13:00:19,672 [se-915-b01]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2018-01-11 13:00:19,706 [d thread 2]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 2ms; general responsiveness: ok; EDT responsiveness: ok 
2018-01-11 13:00:19,766 [d thread 2]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 60ms; general responsiveness: ok; EDT responsiveness: ok 
2018-01-11 13:00:22,373 [d thread 3]   INFO - tools.idea.ddms.adb.AdbService - Initializing adb using: /home/shivam/Android/Sdk/platform-tools/adb, client support = false 
2018-01-11 13:00:22,466 [err reader]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2018-01-11 13:00:26,005 [err reader]   WARN -            #com.android.ddmlib - * daemon started successfully 
2018-01-11 13:00:26,220 [d thread 3]   INFO - tools.idea.ddms.adb.AdbService - Successfully connected to adb 
2018-01-11 13:00:46,918 [se-915-b01]   WARN - vdmanager.AvdManagerConnection - java.nio.file.AccessDeniedException: /home/shivam/.android/avd/Nexus_5X_API_23.ini 
2018-01-11 13:01:04,305 [d thread 1]   INFO - tools.idea.ddms.adb.AdbService - Initializing adb using: /home/shivam/Android/Sdk/platform-tools/adb, client support = true 
2018-01-11 13:01:04,323 [err reader]   WARN -            #com.android.ddmlib - * daemon not running; starting now at tcp:5037 
2018-01-11 13:01:07,454 [err reader]   WARN -            #com.android.ddmlib - * daemon started successfully 
2018-01-11 13:01:07,656 [d thread 1]   INFO - tools.idea.ddms.adb.AdbService - Successfully connected to adb 
2018-01-11 13:01:54,534 [se-915-b01]   WARN - vdmanager.AvdManagerConnection - java.nio.file.AccessDeniedException: /home/shivam/.android/avd/Nexus_5X_API_23.ini 
Sludgy answered 11/1, 2018 at 7:54 Comment(0)
S
19

Ok, I got it working you need to give the 777 permissions to .android folder that is hidden. run the following command in terminal, where hidden folder. You need to use the -R flag, which will recurse into every subdirectory.

For example, running sudo chown -R my_username:my_username .android will make .android and all subdirectories owned by you.

Sludgy answered 11/1, 2018 at 11:54 Comment(2)
Is this for real @quasipolynomial @Shivam, this will remove the .android be careful with this!Midlands
I used this command and worked fine for me but one small improvement sudo chown -R my_username:my_groupname .android If there is no groupname the command can be sudo chown -R my_username: .androidWalkway
S
6

For Mac is used this tutorial to make sure that my root administrator level had access to this file by running this line in the terminal

sudo chown -Rv *UserFolderName /Users/*UserFolderName/.android

for the above *UserFolderName should be changed the user that will be using Android Studio (most probably you)

Spiv answered 25/9, 2018 at 3:1 Comment(0)
O
2

Android Studio is trying to write a file(s) to the /home/shivam/.android/avd folder but there is some form of problem with permissions.

Check the permissions on the /home/shivam/.android folder. For some reason, when installing, Android Studio creates this folder with root access only but then, subsequently, was unable to create an avd folder and write out the virtual device files.

Fix is to give yourself root access and change the owner of the /home/shivam/.android folder to your username.

Obstinate answered 11/1, 2018 at 8:13 Comment(0)
A
1

Check the actual log since the error might be very different. The log can be located as described at https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files enter image description here

In my case the problem was an already existing folder (probably remained from a failed try). I deleted it and it worked.

Agglomerate answered 3/5, 2022 at 10:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.