I'm trying to get the Android platform working on Cordova, but I'm running into what seems to be a permissions problem.
kevin@CM-Ubuntu-Main:~/workspace/HelloCordova$ cordova platform add android
Error: EACCES, open '/home/kevin/.cordova/lib/npm_cache/cordova-android/3.6.4/package/.npmignore'
I know that a lot of people who seem to have the same problem fixed it by adding the Android SDK to their PATH variable. I tried that and it doesn't seem to be working. I can run "android" straight from the terminal and use the Update Manager, but Cordova still doesn't seem to recognize it.
Here are some of my environment variables, in case something looks off.
kevin@CM-Ubuntu-Main:~/workspace/HelloCordova$ printenv
ANDROID_HOME=/home/kevin/.android-sdk-linux/sdk/tools
PATH=
/usr/local/heroku/bin:
/home/kevin/bin:
/usr/lib/lightdm/lightdm:
/usr/local/sbin:
/usr/local/bin:
/usr/sbin:
/usr/bin:
/sbin:
/bin:
/usr/games:
/home/kevin/.android-sdk-linux/sdk/tools:
/home/kevin/.android-sdk-linux/sdk/platform-tools
PWD=/home/kevin/workspace/HelloCordova
JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64
HOME=/home/kevin
I saw that some other users have found it was a permissions problem, so I tried using sudo chown -R $(whoami)
to fix my ~/.npm
and node-modules
folders, but that didn't help, either. I finally tried reinstalling Node.js, npm, and Cordova globally using this guide so that can everything is accessible to both user and root, and that seems to be working for everything else that uses Node. I can build the browser target in Cordova, as well, so the problem is probably with Android, but I can't figure out what to do next.
Here are the software versions I'm using:
Ubuntu 12.04
node 0.10.26
npm 1.4.3
cordova 4.2.0
Android APIs 21, 20, 19, 18, and 10