1

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
Mirko Cianfarani
  • 2,023
  • 1
  • 23
  • 39
  • what happens when you run it as sudo (not sure which directories its writing to) – ali haider Jan 16 '14 at 03:02
  • ´sudo android create avd -n mySim -t android-19 [sudo] password for user: sudo: android: command not found´ – Mirko Cianfarani Jan 16 '14 at 03:05
  • 1
    android is not located in the system path. You need to gogo into the directory where the file android is found then repeat the command bbut with ./android not android. sudo android create avd -n mySim -t android-19 If that works, then it's a permission things and you change the permissions of that folder recursively. Sudo chmod 777 folder -r – possumkeys Jan 16 '14 at 03:14
  • 1
    now function using sudo -s chmod -R 777 /home/user/.android/ – Mirko Cianfarani Jan 16 '14 at 03:18
  • why now I have this error after that I create AVD user@user-F50Sf:~$ emulator -avd mySim NAND: could not write file /home/user/.android/avd/mySim.avd/userdata-qemu.img, No such file or directory – Mirko Cianfarani Jan 16 '14 at 03:19

1 Answers1

2

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.

Gustavo J.C.
  • 316
  • 4
  • 8
  • To add to this, there were several places where my permissions were off. First, I installed the android-tools-adb package in Ubuntu and had to run it as root, so when it created the .android directory in my home director (~/.android), it created it as root. Second, when I did ```./configure; make; make install``` for android studio, I also used ```sudo```, so I had to change those director permissions, too (though I'm not convinced this was crucial -- I'm just not willing to go back and test without changing them.) – kael Jun 04 '16 at 20:30