0

I want to reference a 3th party library:

import com.googlecode.mp4parser.authoring.Movie;

but in android studio, gradle puted the library in C:\Users\flieks\.gradle\...

Now how do i "export" the plugin project? i want to have mp4parser somewhere in folders src\android\main.java

Greetings Felix

flieks
  • 175
  • 1
  • 3
  • 13

2 Answers2

1

You can reference a Gradle file in your plugin to allow you to pull in other libraries (if I'm understanding your question correctly). Check out plugin.xml in the crosswalk-webview plugin for an example on how to add one in:

https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview/blob/master/plugin.xml

Once you do that you can import the class in your plugin code.

Chuck Lantz
  • 1,440
  • 1
  • 8
  • 10
  • thanks chuck that worked. Do you know a solution for my other question? http://stackoverflow.com/questions/34406779/add-org-apache-cordova-to-build-gradle thanks – flieks Dec 22 '15 at 00:50
  • I don't know that any of the jars are in a maven repo. They are local to plugins and platform implementations from what I've seen. Plugins are acquired in recent versions of Cordova using npm. If you want to use something from another plugin, you can add a dependency in plugin.xml. No need to do anything with maven. – Chuck Lantz Jan 04 '16 at 16:07
0

adding this to the plugin.xml did the trick

  <platform name="android">
    <config-file parent="/*" target="res/xml/config.xml">
      <feature name="Mp4Parser">
        <param name="android-package" value="com.catwalk.mp4parser.Mp4Parser" />
      </feature>
    </config-file>
    <config-file parent="/*" target="AndroidManifest.xml" />
    <source-file src="src/android/Mp4Parser.java" target-dir="src/com/catwalk/mp4parser/Mp4Parser" />
    <framework src="src/android/build.gradle" custom="true" type="gradleReference" />
  </platform>

and this in same folder as the JAVA file

dependencies {
  compile group: 'com.googlecode.mp4parser', name: 'isoparser', version: '1.1.7'
}
flieks
  • 175
  • 1
  • 3
  • 13