Mirko Cianfarani
Mirko Cianfarani

Reputation: 2103

Error while creating android AVD: (Permission denied) inside Ubuntu

I am beginner to program apps IOS and Android.

I have Eclipse with Android SDK and AVD inside Ubuntu.

When I launch android from the terminal. This call Android SDK Manager

I open this question because the problem is when I create the device AVD. I installed two version of Android:

user@user-F50Sf:~/Downloads$ android list targets
Available Android targets:
----------
id: 1 or "android-18"
     Name: Android 4.3
     Type: Platform
     API level: 18
     Revision: 2
     Skins: WXGA800, WXGA800-7in, WSVGA, WQVGA400, HVGA, WXGA720, WVGA800 (default), QVGA, WQVGA432, WVGA854
     ABIs : no ABIs.
----------
id: 2 or "android-19"
     Name: Android 4.4.2
     Type: Platform
     API level: 19
     Revision: 2
     Skins: WXGA800, WXGA800-7in, WSVGA, WQVGA400, HVGA, WXGA720, WVGA800 (default), QVGA, WQVGA432, WVGA854
     ABIs : armeabi-v7a
user@user-F50Sf:~/Downloads$  

Android SDKNow I want to create the new device from terminal and I have this error:

 user@user-F50Sf:~/Downloads$ android create avd -n mySim -t android-19
    Auto-selecting single ABI armeabi-v7a
    Android 4.4.2 is a basic Android platform.
    Do you wish to create a custom hardware profile [no]
    Error: /home/user/.android/avd/mySim.ini (Permission denied)

This error I have also inside Eclipse always when I create new device AVD Image of error eclipse

I try to add the path of Phonepag inside the /etc/profile, after I update it. But the terminal gets still the error

/etc/profile

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

# The default umask is now handled by pam_umask.
# See pam_umask(8) and /etc/login.defs.

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
export PATH=${PATH}:/opt/android-sdk-linux/tools
export PATH=${PATH}:/opt/android-sdk-linux/platform-tools
export PATH=${PATH}:/usr/lib/node_modules/phonegap/bin

Where I wrong???

EDIT: Using sudo I have command not found

sudo android create avd -n mySim -t android-19
[sudo] password for user: 
sudo: android: command not found

Upvotes: 1

Views: 5610

Answers (1)

Gustavo J.C.
Gustavo J.C.

Reputation: 316

The AVD Manager can't acess the .android folder. Not sure if its the right solution, but changing the permission of the folder worked for me:

sudo chmod 777 -R /home/user/.android

The "user" here is the user which is executing the AVD Manager, most probably your user.

Upvotes: 2

Related Questions