3

Whenever I try to build a project using phonegap run, I get the below error:

C:\Users\MS AwaN\my-app>phonegap run android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
   [error] An error occured during creation of android sub-project.

C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:126
                    throw e;
                          ^
Error: An error occurred while listing Android targets
    at C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\lib\check_reqs.js:87:29
    at _rejected (C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:808:24)
    at C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:834:30
    at Promise.when (C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:1079:31)
    at Promise.promise.promiseDispatch (C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:752:41)
    at C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:574:44
    at flush (C:\Users\MS AwaN\.cordova\lib\android\cordova\3.3.0\bin\node_modules\q\q.js:108:17)
    at process._tickCallback (node.js:415:13)

Can anyone please suggest what I am doing wrong?

admdrew
  • 3,790
  • 4
  • 27
  • 39
Seemab Hassan
  • 63
  • 1
  • 10

2 Answers2

2

I had the same problem and this fixed it. Alternately look here (which is the same but has a link to the documentation which I also missed).

Community
  • 1
  • 1
0

It seems that phonegap 3.3 requires android sdk 19.

If you have a older one, try the following steps :

  1. delete the platforms/android folder (as the log say "Adding the android platform", I assume you didn't perform any customisations in that folder)
  2. use android sdk manager to install the latest sdk
  3. retry with phonegap build android and if it fails, run phonegap -V build android to get more details on the error
QuickFix
  • 11,661
  • 2
  • 38
  • 50