Alexandre
Alexandre

Reputation: 3170

Phonegap cordova no such file build.template

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?

Upvotes: 0

Views: 2723

Answers (1)

lastbear
lastbear

Reputation: 46

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"

Upvotes: 3

Related Questions