Once the phonegap installation is done, I created a phonegap project and try to build it. I get below error.
username@userpc:~/phonegap/testapp$ cordova build
cp: no such file or directory: /home/username/phonegap/testapp/icon.png
Running command: /home/username/phonegap/testapp/platforms/android/cordova/build
/home/username/phonegap/testapp/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error: ENOENT, no such file or directory '/home/username/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/username/phonegap/testapp/platforms/android/cordova/lib/build.js:120:40
at _fulfilled (/home/username/phonegap/testapp/platforms/android/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/username/phonegap/testapp/platforms/android/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/username/phonegap/testapp/platforms/android/cordova/node_modules/q/q.js:760:13)
at /home/username/phonegap/testapp/platforms/android/cordova/node_modules/q/q.js:574:44
at flush (/home/username/phonegap/testapp/platforms/android/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
ERROR building one of the platforms: Error: /home/username/phonegap/testapp/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project
When I run phonegap build
it gives me below output but the application does not work.
username@userpc:~/phonegap/testapp$ phonegap build
[phonegap] executing 'cordova build'...
[phonegap] completed 'cordova build'
How can I fix this?