-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil #133
Comments
What happens if you follow the manual instructions here instead? |
@saudet Hi Samuel. I tried downloading the bin files and adding them as dependencies, as the installation guide said, but still didn't work. Then I did some more search and extract opencv-android-arm.jar and ffmpeg-android-arm.jar and copy all the result .so files under app/src/main/jniLibs/armeabi-v7a/ and now it works. |
Ok, please let me know the cause of the problem if you find it out! I would like to fix this issue. Thanks |
@saudet According to the first answer of this question, It seems that if you already have an armeabi(or armeabi-v7a) folder in your project (in AndroidStudio, it's typically under app/src/main/jniLibs/ folder) that contains other .so files, then the .so files included in opencv-android-arm.jar and ffmpeg-android-arm.jar may not be imported into the project. That causes the ClassNotFoundException. |
@saudet Before this issue is fixed, do you think it would be better to update the manual installation to tell users to try extracting .so files and put them under armeabi-v7a folders? Something like
This might save a lot of time for guys in the same situation as my. |
I see, so this appears to be caused by a bug in Android Studio... Would you know of a better workaround? In any case, thanks for reporting and letting us know what the problem was! I'll update the |
I'm using AndroidStudio1.2 on Windows7(32bit). I have same problem. I did same workaround, but I had error (maybe same cause).
I built java by using Maven central, I had same error. compile group: 'org.bytedeco', name: 'javacv', version: '0.11'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.11-0.11', classifier: 'android-arm'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.6.1-0.11', classifier: 'android-arm' I spent two days... |
@nskr Could also provide any messages you get about “avutil“ in Android's log? Thanks! |
I also edited build.gradle like this: sourceSets {
main {
jniLibs.srcDir 'src/main/jniLibs'
}
} folder structure is:
I found *.so files in my app's apk file:
But, it still does not work. thanks for your reply. |
@nskr Well, your device might be x86, so it would help if you could provide the information given in your Android log, thanks. |
OK, I'll try again to use x86 folder. |
It worked! My build.gradle is: compile group: 'org.bytedeco', name: 'javacv', version: '0.11'
compile group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '2.4.11-0.11', classifier: 'android-x86'
compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '2.6.1-0.11', classifier: 'android-x86' Thanks |
Ok so I found a solution that works on both x86 and arm: Proguard settings:
Build.gradle:
This is based on my SO question: http://stackoverflow.com/questions/30078380/proguard-removing-annotations-in-android-application/30130559#30130559 Note that there may a few proguard rules redundant, but at least it works. Note that I ran this with proguard 5.1, AS currently has 4.7 which apparently also has issues with annotations. |
@lfdversluis Please post anything else you find about ProGuard here: #79 |
And what happens if you simply add the JAR files instead?
|
i have the same issue ,but my device is arm, spent too much time on it, please help,
|
btw, i use the sample project of javacv-android-example, on android 5.0 is ok, but on 4.0.3 shows the error |
@zouyongdang thank you so much. i fixed. i extracted "jar xf opencv-android-arm.jar" and "ffmpeg-android-arm.jar" after than i moved *.so files to "app/src/main/jniLibs/armeabi-v7a" folder and it worked for me. |
The issue ( #319) links an answer here (http://stackoverflow.com/questions/35066470/using-javacv-and-realm-together-causes-java-lang-unsatisfiedlinkerror/35088655#35088655) when i try to add a line "ndk { abiFilters "armeabi-v7a" }" in defaultConfig. Android studio give me an error "Error:(13, 0) Error: NDK integration is deprecated in the current plugin. Consider trying the new experimental plugin. For details, see http://tools.android.com/tech-docs/new-build-system/gradle-experimental. Set "android.useDeprecatedNdk=true" in gradle.properties to continue using the current NDK integration. Can any one tell how to add these two line in detail... |
I solve the problem here just use a lower sdk verison 18 to run mu code .Getting stuck Many Days just because of SDK verison!!! |
I am getting this error on the Nexus 5x running Marshmallow. However, everything is working fine on my Nexus 5 running Marshmallow, HTC One m8 running Lollipop, and Galaxy Nexus running Jellybean. Any ideas on what would be causing this?? I copied the .so files to the armeabi and armeabi-v7a folders, and placed the javacv, javacpp, opencv, and ffmpeg jars in my libs folder. I have tried every other installation method, but this way seems to have the best results. |
Make sure the device is installing the libraries properly: |
Hi, I faced this problem a few days ago and solved it. and change my targetSDKversion to 18 at build.gradle.. Now, it's working Hope this will help someone |
Try this code to analyze or run "clean project"
|
I have tried to configure ProGuard, and extracted .so files and put them under armeabi folders, but still get classNotFound error. So do I need to try to use ReLinker? |
@elyonsaber There are common issues with that on Android devices yes: |
Thanks for your prompt reply! I will try it, and hope it will work. |
After using ReLinker, I was able to install and run app on device that could run JavaCv1.1 successfully. However for the devices that failed to run 1.1 like , using 1.2 version still occurs error. |
@elyonsaber Make sure you are using JavaCPP 1.2.2. There are known issues with JavaCPP 1.2: #412 |
Closing this since there doesn't appear to be a satisfactory way to fix this other than by having Google fix Android Studio. I've documented the workaround here: https://github.com/bytedeco/javacpp-presets/wiki/Issues-with-Build-Tools#android-studio |
Hi! I got same issue use all possible solution but still not able to figure it out. Here is logcat error
Here is app module gradle
I am using compileSdkVersion 24 and buildToolsVersion "24.0.3". |
bytedeco/javacv#133 의 zouyongdang commented on 27 Apr 2015 해결 솔류션을 참고하여 외부 라이브러리 임포트 실패 버그를 픽스함
Hi I am running following example code to convert video files to jpg frames on Ubuntu 14.04 VM instance.import java.awt.image.BufferedImage; public class MovieToImage {
|
09-07 11:56:21.548 9866-9866/com.lmy.samples E/AndroidRuntime: FATAL EXCEPTION: main |
@Nischitha-S Have you tried to use ReLinker? |
64-bit builds for Android (as the "android-arm64" and "android-x86_64" platforms) are now available, so please give it a try! Binaries for 1.4.1-SNAPSHOT can be downloaded from the snapshot repository: http://bytedeco.org/builds/ |
I'm using AndroidStudio1.2 on Mac and trying to get RecordActivity to work. I downloaded the bin.zip and added
to my gradle file(already put related files under app/libs). But still ran into this error:
Oddly enough, I can open the file in the editor. Anyone tell me how to fix this?
The text was updated successfully, but these errors were encountered: