Search code examples
android-studiogradlecordova-pluginsvisual-studio-cordova

cordova custom plugin use 3th party JAVA lib gradle


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


Solution

  • 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'
    }