Skip to content
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

No jniopencv_core UnsatisfiedLinkError Android Studio #56

Closed
cmosboss opened this issue Nov 24, 2014 · 5 comments
Closed

No jniopencv_core UnsatisfiedLinkError Android Studio #56

cmosboss opened this issue Nov 24, 2014 · 5 comments

Comments

@cmosboss
Copy link

I am trying to install JavaCV so I can use FFMPEG in my project. Specifically I am trying to use the sample code "RecordActivity" I have created a brand new project, followed the install instructions and then the specific OpenCV / FFMPEG instructinos https://github.com/bytedeco/javacv#manual-installation-for-opencv-and-ffmpeg and I am still gettting the error referenced several times on the forums about jniopencv_core and opencv_core not being referenced. Do you think it is an android studio issue? I tried doing eclipse and has the same issue although I did not go through it as thoroughly. Issues that are related to this.
#28
#1
#9

I am using the 9.0 release using gradle

    dependencies 
   {
        compile group: 'org.bytedeco', name: 'javacv', version: '0.9'
    }

is there a more up to date version I could try? or something im not doing?

@saudet
Copy link
Member

saudet commented Nov 29, 2014

Apparently Android Studio doesn't work with JAR files for JNI libraries anymore. We'd need to build an AAR file for that:
http://tools.android.com/tech-docs/new-build-system/aar-format
If this is something you'd like to work on, please let me know. It would be something useful for many people I'm sure. For now, it looks like we need to do it the manual way by copying the native files to a subdirectory of the the jniLibs project folder, a procedure that doesn't seem to be documented officially anywhere...

@cmosboss
Copy link
Author

I wish I knew how to do that or I would love to help out!

@saudet
Copy link
Member

saudet commented Dec 23, 2014

Manually installing the JAR files in Android Studio work fine though. I've updated the instructions for that here:
https://github.com/bytedeco/javacpp-presets/tree/develop#manual-installation

@MkrMkr
Copy link

MkrMkr commented Jan 8, 2015

Looks like the way with copying native files to jniLibs... doesn't work anymore. My project suddenly starts crashes today and I get error (one of my favorite): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_core: findLibrary returned null.
Please tell me that I'm wrong.
Edit. I tried also with new projects

@saudet
Copy link
Member

saudet commented Jan 10, 2015

Extracting all the native libraries to app/src/main/jniLibs should still work, but it's easier to just copy the JAR files themselves to the app/libs directory. I've confirmed that Android Studio's Gradle still does the extracting of JAR files for us:
https://github.com/bytedeco/javacv#manual-installation
So I guess I'll close this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants