Where is cordova-2.7.0.jar?
Asked Answered
C

4

9

I struggle to build a first Android app from HTML5.

So, I follow this detailed tutorial...

It seems that I should add a .jar of Cordova to the project's libs folder, in order to be able to call Cordova's functionnalities in my app.java file. However, I can't find this cordova-2.7.0.jar file anywhere.

Maybe shall I generate it? Therefore I tried an other option, by creating the project from the command line tool following the official getting started guide, but there's no cordova.jar either in the generated project files.

I feel Cordova is not so easy to handle at first...

(By the way, I'm also looking for a Cordova JS file...)


EDIT: To answer to poiuytrez, here is my cordova package, downloaded from http://cordova.apache.org/ enter image description here

Circassia answered 19/5, 2013 at 17:15 Comment(0)
C
11

I finally found a solution following the github doc https://github.com/apache/cordova-android#building

First, you need the commons-codec-1.7.jar file. It's downloaded to cordova-android using create : Check http://cordova.apache.org/docs/en/2.7.0/guide_getting-started_android_index.md.html

create <project_folder_path> <package_name> <project_name>"
  • project_folder_path is the path to your new Cordova Android project
  • package_name is the package name, e.g. com.YourCompany.YourAppName
  • project_name is the project name, e.g. YourApp (Must not contain spaces)

This process should download commons-codec-1.7.jar.

Then, the following step is not explained in the getting started guide: cordova-2.7.0.jar has to be generated with an ant command line, after having copied the commons-codec-1.7.jar to the framework/lib directory.

android update project -p . -t android-17
ant jar

And here we go!

Circassia answered 20/5, 2013 at 9:17 Comment(2)
oh god... phonegap is such a mess. I'm trying to install this pile or errors for 3 days now. Your solution isn't clear to me. I created a project via command prompt create. Now where exactly should the commons-codec-1.7.jar be downloaded to? Where can i find it?Fortunetelling
And when you download phonegap 2.9 they have done away with the Jar file and appear to have all the source in the zip file. as Sumit said ..... what a mess!Misplace
D
13

In order to obtain the cordova.2.x.x.jar file you only have to do the following steps:

  1. Download from the Phonegap website the project. For version 2.9.1 follow this link: http://phonegap.com/install/ and navigate to the version your looking for (2.9.1) it will link you to https://github.com/phonegap/phonegap/archive/2.9.1.zip

  2. Once downloaded and unzipped, navigate into the directory framework in phonegap-2.9.1/lib/android/framework

  3. You will have to choose the version of android you want to use it will be your target version of android that phonegap will be compiled for, if you have downloaded the Android SDK and added to the path variable of your system (if you have not look below) you can do this:

    android list targets
    

(If you dont have the SDK in you system path yet, you will need to add two directories tool and platform-tools that are inside the SDK folder. Try the previos command and...)

It will give you an answer like this one:

    Available Android targets:
    ----------
    id: 1 or "android-8"
    Name: Android 2.2
    Type: Platform
    API level: 8
    Revision: 3
    Skins: WQVGA432, QVGA, WQVGA400, WVGA854, WVGA800 (default), HVGA
    ABIs : armeabi
    ----------
    id: 2 or "android-17"
    Name: Android 4.2.2
    Type: Platform
    API level: 17
    Revision: 2
    Skins: WXGA720, WXGA800-7in, WQVGA432, WSVGA, QVGA, WQVGA400, WXGA800, WVGA854, WVGA800 (default), HVGA
    ABIs : armeabi-v7a, x86
    ----------
    id: 3 or "Google Inc.:Google APIs:17"
    Name: Google APIs
    Type: Add-On
    Vendor: Google Inc.
    Revision: 3
    Description: Android + Google APIs
    Based on Android 4.2.2 (API level 17)
    Libraries:
    * com.google.android.media.effects (effects.jar)
      Collection of video effects
    * com.android.future.usb.accessory (usb.jar)
      API for USB Accessories
    * com.google.android.maps (maps.jar)
      API for Google Maps
    Skins: WVGA854, WQVGA400, WSVGA, WXGA800-7in, WXGA720, HVGA, WQVGA432, WVGA800 (default), QVGA, WXGA800
    ABIs : armeabi-v7a
    ----------
    id: 4 or "android-19"
    Name: Android 4.4
    Type: Platform
    API level: 19
    Revision: 1
    Skins: WXGA720, WXGA800-7in, WQVGA432, WSVGA, QVGA, WQVGA400, WXGA800, WVGA854, WVGA800 (default), HVGA
    ABIs : armeabi-v7a
  1. I choose the last one so I did:

    android update project -p . -t android-19
    
  2. And finally

    ant jar
    

    The result is something like:

    [jar] Building jar: /home/jgonzalezd/Downloads/phonegap-2.9.1/lib/android/framework/cordova-2.9.1.jar
    
    BUILD SUCCESSFUL
    Total time: 10 seconds
    

Now you've got your jar.

Digitate answered 18/1, 2014 at 3:32 Comment(3)
How to get it for linux?Glint
Hello @Glint it was made in linux, as you can see in the directory structure /home/jgonzalez/Digitate
Worked perfectly, thanks! I downloaded Cordova version from apache.org/dist/cordova/platforms, not from PhoneGapShaniqua
C
11

I finally found a solution following the github doc https://github.com/apache/cordova-android#building

First, you need the commons-codec-1.7.jar file. It's downloaded to cordova-android using create : Check http://cordova.apache.org/docs/en/2.7.0/guide_getting-started_android_index.md.html

create <project_folder_path> <package_name> <project_name>"
  • project_folder_path is the path to your new Cordova Android project
  • package_name is the package name, e.g. com.YourCompany.YourAppName
  • project_name is the project name, e.g. YourApp (Must not contain spaces)

This process should download commons-codec-1.7.jar.

Then, the following step is not explained in the getting started guide: cordova-2.7.0.jar has to be generated with an ant command line, after having copied the commons-codec-1.7.jar to the framework/lib directory.

android update project -p . -t android-17
ant jar

And here we go!

Circassia answered 20/5, 2013 at 9:17 Comment(2)
oh god... phonegap is such a mess. I'm trying to install this pile or errors for 3 days now. Your solution isn't clear to me. I created a project via command prompt create. Now where exactly should the commons-codec-1.7.jar be downloaded to? Where can i find it?Fortunetelling
And when you download phonegap 2.9 they have done away with the Jar file and appear to have all the source in the zip file. as Sumit said ..... what a mess!Misplace
S
0

If there is ANOTHER project loaded with your Phonegap project into Eclipse, then try to "Project >> Build All" on this project called "Something-CordovaLib" and after that "Project >> Clean..." your Phonegap application. This worked for me. Then the .jar file is magically created (or the dependency is somehow resolved)

Sanjay answered 9/1, 2014 at 18:37 Comment(0)
H
-2

You have downloaded your package from the Apache Cordova. You should download it from Phonegap instead.

When you extract phonegap-2.7.0.zip, the jar and js files are located in:

phonegap-2.7.0\lib\android\

enter image description here

Hast answered 20/5, 2013 at 7:46 Comment(2)
Thanks for your answer. However, I can't find it in my package, which is very different. Where did you download yours? It is not present either in the package available from Phonegap...Circassia
I see. You have to download it from phonegap.com instead of apache.org. I downloaded it from this link: s3.amazonaws.com/phonegap.download/phonegap-2.7.0.zipHast

© 2022 - 2024 — McMap. All rights reserved.