Java – cordova plugin adds external .aar files (not .jar)

cordova plugin adds external .aar files (not .jar)… here is a solution to the problem.

cordova plugin adds external .aar files (not .jar)

I’m writing a plugin to use filepicker’s native android SDK https://github.com/Ink/filepicker-android .

On Maven Central, they only provide an .aar file ( http://search.maven.org/#artifactdetails%7Cio.filepicker%7Cfilepicker-android%7C3.8.13%7Caar ) instead of a .jar.

If I add this line in my config.xml
<source-file src="src/android/filepicker-android-3.8.13.aar" target-dir="libs/" />

The file was copied in the library, but was not included in the classpath during the pass cordova build build, so the build failed.

What is the best solution to include third-party libraries with aar files?

Thank you for your help

Solution

It is recommended that you can extract jar files from AAR. You may also need to deal with other dependencies.

Related Problems and Solutions