Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I build a Cordova 8.x cordova.jar to include in existing Android app?

I this documentation:

Cordova documentation

I cloned the latest Cordova here: https://github.com/apache/cordova-android

But when I run "ant jar" as described in the documentation, I get this error:

cordova-android-master/framework/build.xml:124: Cannot find /Users/neigaard/Library/Android/sdk/tools/ant/build.xml imported from /Users/me/cordova-android-master/framework/build.xml

Google say that is because ant/build.xml was removed from Android SDK. I found a post saying that I should download a old Android SDK tools and replace my SDK tools folder with that, but I rely on my Android SDK to be working and up to date.

Is there no way to build the Cordova Android jar without an outdated Android SDK or is there somewhere I can download a pre-built jar or is there another way to integrate Cordova into a existing Android app?

like image 607
Neigaard Avatar asked Jun 22 '18 13:06

Neigaard


People also ask

Do I need Android studio for Cordova?

Cordova-Android requires the Android SDK, which can be installed on either macOS, Linux, or Windows. For the base system requirements, see the Android Studio's System Requirements.

Which of the following version of Java is recommended for Cordova app?

Install Java Development Kit (JDK) 7 or later.


1 Answers

You don't really need the .jar anymore, Cordova is distributed through gradle, so you can just add this in the dependencies section of your app gradle file:

implementation 'org.apache.cordova:framework:7.1.0'

like image 168
jcesarmobile Avatar answered Nov 15 '22 14:11

jcesarmobile