libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
145 stars 50 forks source link

gdx-jnigen transitivity #62

Closed collinsmith closed 3 years ago

collinsmith commented 3 years ago

I'm trying to implement this into my existing project via a tool to test it and I'm having issues where gdx-jnigen must be manually added as a dependency due to the use of JniGenSharedLibraryLoader at com.badlogic.gdx.video.FfMpeg.loadLibraries(FfMpeg.java:49). I've noticed that it was explicitly excluded as a transitive dependency, however it's included in with extensions such as gdx-box2d which also use native libraries.

https://github.com/libgdx/gdx-video/blob/master/gdx-video-desktop/src/com/badlogic/gdx/video/FfMpeg.java#L47-L52

In the meantime, I've just added it to my dependencies

implementation "com.badlogicgames.gdx:gdx-jnigen:$gdxVersion"

Stack trace

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoClassDefFoundError: com/badlogic/gdx/jnigen/JniGenSharedLibraryLoader
        at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:134)
Caused by: java.lang.NoClassDefFoundError: com/badlogic/gdx/jnigen/JniGenSharedLibraryLoader
        at com.badlogic.gdx.video.FfMpeg.loadLibraries(FfMpeg.java:49)
        at com.badlogic.gdx.video.CommonVideoPlayerDesktop.play(CommonVideoPlayerDesktop.java:75)
        at com.riiablo.video.VideoPlayerTool$3.run(VideoPlayerTool.java:102)

build.gradle (before adding gdx-jnigen)

dependencies {
  implementation "com.badlogicgames.gdx-video:gdx-video:1.3.2-SNAPSHOT"
  implementation "com.badlogicgames.gdx-video:gdx-video-lwjgl:1.3.2-SNAPSHOT"
}
SimonIT commented 3 years ago

I changed to the included loader in 2f9b23432e7b8e2e165285a8488c70be6612edf7, so there shouldn't be an issue with this