0

When I try to run the android emulator with "cordova run android -V" I get the following error:

Running command: /home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/run 

/home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error: ENOENT, no such file or directory '/usr/local/android-sdk-linux/tools/tools/lib/build.template'
    at Object.fs.openSync (fs.js:432:18)
    at Object.fs.readFileSync (fs.js:286:15)
    at /home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/lib/build.js:120:40
    at _fulfilled (/home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/node_modules/q/q.js:798:54)
    at self.promiseDispatch.done (/home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/node_modules/q/q.js:827:30)
    at Promise.promise.promiseDispatch (/home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/node_modules/q/q.js:760:13)
    at /home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/node_modules/q/q.js:574:44
    at flush (/home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)
ERROR running one or more of the platforms: Error: /home/alexandre/dev/phonegap/helloWorld/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project

I did set the variable:

export ANDROID_HOME="/usr/local/android-sdk-linux/tools"
export ANDROID_PLATFORM_TOOLS="/usr/local/android-sdk-linux/platform-tools"
export PATH="$PATH:$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS"

When I execute the command "android" the package manager work correctly. How can I solve this problem?

1 Answer 1

3

change ANDROID_HOME and PATH variable:

export ANDROID_HOME="/usr/local/android-sdk-linux"
export ANDROID_PLATFORM_TOOLS="/usr/local/android-sdk-linux/platform-tools"
export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_PLATFORM_TOOLS"
1
  • Seem to work even if I get a new error: "CPU acceleration status: KVM is not installed on this machine (/dev/kvm is missing)." but seem to be people with the same issue if I google it ;-)
    – Alexandre
    Jan 22, 2015 at 16:42

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.