Problems with PhoneGap

6

I discovered this PhoneGap a short time ago, but today I wanted to meet you. Well, as I said on the site, I needed to download NodeJS and run a command in CMD to install PhoneGap.

After this, you needed to create a folder for PhoneGap to register as an application to be developed.

The site said that I needed to run this in the project folder:

phonegap run android

But when I ran the command, I returned the following error in my CMD window:

E:\Outros\PhoneGap\fenix>phonegap run android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[phonegap] missing library cordova/android/3.3.0
[phonegap] downloading https://git-wip-us.apache.org/repos/asf?p=cordova-androi
.git;a=snapshot;h=3.3.0;sf=tgz...
   [error] An error occured during creation of android sub-project.

C:\Users\iXaDe\.cordova\lib\android\cordova.3.0\bin\node_modules\q\q.js:126
                    throw e;
                          ^
Error: ERROR : executing command 'ant', make sure you have ant installed and ad
ed to your path.
    at C:\Users\iXaDe\.cordova\lib\android\cordova.3.0\bin\lib\check_reqs.js:
7:27
    at ChildProcess.exithandler (child_process.js:641:7)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:735:16)
    at Socket.<anonymous> (child_process.js:948:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:466:12)

EDIT

After installing ant , phonegap still reports error:

  E:\Outros\PhoneGap\fenix>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\iXaDe\.cordova\lib\android\cordova.3.0\bin\node_modules\q\q.js:126
                       throw e;
                      ^
   Error: Please install Android target 19 (the Android newest SDK). Make sure you
   have the latest Android tools installed as well. Run "android" from your command
   -line to install/update any missing SDKs or tools.
       at C:\Users\iXaDe\.cordova\lib\android\cordova.3.0\bin\lib\check_reqs.js:8
   0:29
    
asked by anonymous 22.01.2014 / 00:22

1 answer

7

Your error:

  

Error: Please install Android target 19 (the Android newest SDK). Make sure you have the latest Android tools installed as well. Run "android" from your command line to install / update any missing SDKs or tools.

That translates to:

  

Error: Please install Android version 19 (the latest version of the Android SDK). Also make sure you have the latest version of Android tools installed as well. Run "android" from the command line to install / update any missing SDKs or tools.

Tell us that your problem can be one of two:

  • You have what you need but you do not have the paths configured;
  • You do not have what you need to install and you need to install it.

  • Handle Paths

    You have two ways to add the Android SDK to% windows%. For the sake of clarity, let's assume you have the installation in:

    C:\android-sdk-windows\tools
    
  • Command Line

    From the command line you can execute:

    set path=%path%;C:\android-sdk-windows\tools;
    
  • Graphic Environment

    You can access the environment and edit variables configuration dialog to add the desired path:

  • Access to:

      "My Computer" → "Properties" → "Advanced" → "Environment Variables";

  • Choose and edit the variable path :

  • Attheendaddthepath:

    C:\android-sdk-windows\tools;

    Specialattentiontousingpathtoseparatefromexistingpaths.


  • Install what is missing

    If you do not have the Android SDK, at least the requested version is 19, you should install it before proceeding to check the paths.

    SDK Tools | Android Developers

    And this is to deal with the error you are having. Other errors may arise after this one, but it is another matter that deserves another question.

        
    22.01.2014 / 02:26