UnsatisfiedLinkError using JavaCV maven dependency in Gradle on Android

时间:2015-07-28 16:57:32

标签: java android ffmpeg javacv javacpp

I am getting this error when trying to call the start() method of an instance of FFmpegFrameGrabber :

java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil
    at java.lang.Class.classForName(Native Method)
    at java.lang.Class.forName(Class.java:309)
    at org.bytedeco.javacpp.Loader.load(Loader.java:390)
    at org.bytedeco.javacpp.Loader.load(Loader.java:358)
    at org.bytedeco.javacpp.avformat$AVFormatContext.<clinit>(avformat.java:2539)
    at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:383)
    at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:377)

These are the dependencies I am referring to per the READMES for the projects javacpp and javacv:

compile group: 'org.bytedeco', name: 'javacpp', version: '1.0'
compile group: 'org.bytedeco', name: 'javacv', version: '1.0'

I did not add any .so files to the project, but I was expecting those to come with the dependencies. When I tried adding them previously I started getting gradle errors for duplicate files so I assume that they come with the dependencies.

I think what is happening is that it can't load the .so files for whatever reason, but I don't know how to solve this problem.

I have tried setting the systemProperty for dependencies mentioned in the GitHub READMEs like so:

task execute(type: JavaExec) {
    systemProperty "platform.dependencies", true
}

It doesn't help as written.

Why is this error seen and what can be done to handle it?

Any guidance on this issue would be greatly appreciated. The overall goal is to use the FFmpegFrameGrabber to crop video the user has taken with their device. I am open to all solutions.

0 个答案:

没有答案