Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phonegap run android - create Command failed with exit code 8 - linux

I did some googleing but find nothing approriate. Any help appreciated. Try it with an naked vm to be sure having no nodejs install or dependency issue.

Christian

sudo apt-get install nodejs
sudo apt-get install nodejs-legacy 
sudo npm install -g phonegap 
sudo npm install -g cordova
sudo apt-get install ant

chris@mint16 ~/project/dev $ phonegap create my-app
[phonegap] create called with the options /home/chris/project/dev/my-app       com.phonegap.helloworld HelloWorld
[phonegap] Customizing default config.xml file
[phonegap] created project at /home/chris/project/dev/my-app
chris@mint16 ~/project/dev $ cd my-app/
chris@mint16 ~/project/dev/my-app $ phonegap run android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...

/home/chris/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:126
                throw e;
                      ^
Error: An error occurred while listing Android targets
at /home/chris/.cordova/lib/android/cordova/3.5.0/bin/lib/check_reqs.js:87:29
at _rejected  (/home/chris/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:808:24)
at /home/chris/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:834:30
at Promise.when    (/home/chris/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/home/chris/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:752:41)
at /home/chris/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:574:44
at flush (/home/chris/.cordova/lib/android/cordova/3.5.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
{ [Error: /home/chris/.cordova/lib/android/cordova/3.5.0/bin/create: Command failed with   exit code 8] code: 8 }
[error] /home/chris/.cordova/lib/android/cordova/3.5.0/bin/create: Command failed with  exit code 8
like image 825
Christian Avatar asked Jun 24 '14 07:06

Christian


2 Answers

I've just faced the same issue, the problem was that path to sdk tools was not properly setup:

So try the following:

export PATH=$PATH:/usr/local/adt-bundle/sdk/tools
export PATH=$PATH:/usr/local/adt-bundle/sdk/platform-tools
export PATH=$PATH:/usr/local/adt-bundle/sdk/build-tools
like image 197
DKMudrechenko Avatar answered Nov 15 '22 23:11

DKMudrechenko


I also hit the same issue, but just adding the various android sdk tools directories to the path as DKMudrechenko suggested above did not help. It turned out that I had not installed ant properly. I had downloaded it from apache.org and just added the ant 'bin' folder to my path, but apparently that wasn't good enough. However, after removing that entry from my path statement and adding ant via brew, I was then able to build the android cordova project successfully using the 'cordova build android' command.

like image 35
curt-miles Avatar answered Nov 15 '22 22:11

curt-miles