5

I am writing a plugin to use the native android SDK of filepicker 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) and not 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 is copy in libs but not included in the class path during the build via cordova build, so the build failed.

what is the best solution to include a third party library with aar files?

Thank you for your help

dbaq
  • 1,347
  • 14
  • 26

2 Answers2

0

Suggestion: you can extract the jar file from the aar. You may have to also take care of other dependencies tho.

Baldor
  • 33
  • 4
0

I found a working solution:

Add a new gradle file containing your dependency:

dependencies {
   compile 'io.filepicker:filepicker-android:3.9.1'
}

In your plugin.xml, reference the extra gradle file:

<!-- android -->
<platform name="android">
    ...
    <framework src="src/android/FilePickerIO.gradle" custom="true" type="gradleReference" />
</platform>

That's all.

dbaq
  • 1,347
  • 14
  • 26