First, I installed PhoneGap:
$ sudo npm install -g phonegap
Then I created a new project:
$ phonegap create hellophonegap
But when I ran 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 have configured the Android SDK environment variables properly. This was added to my .bashrc
:
export ANDROID_SDK=/home/crane/androidsdk
export PATH=$ANDROID_SDK/platform-tools:$ANDROID_SDK/tools:$PATH`
I'm using Ubuntu 14.04, and running PhoneGap v4.1.2-0.22.9
Okay, so your /home/ubuntu/tmp has wrong permissions. It happened because you did sudo npm install in the past, and npm doesn't handle this well enough.
Run sudo chown ubuntu /home/ubuntu/tmp -Rv to fix this issue, or just delete that folder.
I solve th problem on Ubuntu 15.10 removing the folder /home/user/.cordova
sudo rm -r /home/user/.cordova
and running again -$ cordova platform add android
cordova platform add android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With