Failed to get android platform: Error: EACCES

First I installed PhoneGap:

$ sudo npm install -g phonegap 

Then I created a new project:

 $ phonegap create hellophonegap 

But when I started the project:

 $ phonegap run android 

I get the following error:

 [~/hellophonegap]$ phonegap run android [phonegap] executing 'cordova platform add android'... Unable to fetch platform android: Error: EACCES, mkdir '/home/crane/tmp/npm-28555-XalHvwaa' [phonegap] executing 'cordova run android'... No platforms added to this project. Please use 'cordova platform add platform'. 

I configured the Android SDK environment settings correctly. This has been added to my .bashrc :

 export ANDROID_SDK=/home/crane/androidsdk export PATH=$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools:$PATH` 

I am using Ubuntu 14.04 and running PhoneGap v4.1.2-0.22.9

+7
android cordova
source share
4 answers

Ok, so your / home / ubuntu / tmp has the wrong permissions. This happened because in the past you had sudo npm install , and npm doesn't do it well enough.

Run sudo chown ubuntu / home / ubuntu / tmp -Rv to fix this problem or simply delete this folder.

+13
source share

I solve the problem on Ubuntu 15.10 by deleting the /home/user/.cordova folder

 sudo rm -r /home/user/.cordova 

and starts again - $ cordova platform add android

 cordova platform add android 
+5
source share

Failed to get android platform: Error: EACCES, mkdir '/ home / crane / tmp / npm-28555-XalHvwaa'

Use sudo in front of your command for this answer.

+3
source share
 [phonegap] executing 'cordova run android'... No platforms added to this project. Please use 'cordova platform add platform'. 

means that you have not added the platform and are trying to execute it.

You must complete the following sequence:

First, set up telephone power using the command below (which you have already done).

$ sudo npm install -g phonegap

then create a project

$ phonegap create hi com.example.hello HelloWorld

then go to the newly created project directory

cd hi

Now add one or more platforms

 $ phonegap platform add ios $ phonegap platform add amazon-fireos $ phonegap platform add android 

after the platform has been added, now first create it, then run it

for assembly:

$ phonegap build

and now run on the device:

$ phonegap run android

or to run on the simulator

$ phonegap emulate android

Note. - You must have the correct Java, Android, and ANT paths installed.

Please refer to this for more details: http://docs.phonegap.com/en/3.5.0/guide_cli_index.md.html

Look at that too. corova build Failed to execute command with exit code EACCES

0
source share

All Articles