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

UnsatisfiedLinkError for new Mat() on V0.9 #28

Closed
chile12 opened this issue Aug 23, 2014 · 5 comments
Closed

UnsatisfiedLinkError for new Mat() on V0.9 #28

chile12 opened this issue Aug 23, 2014 · 5 comments

Comments

@chile12
Copy link

chile12 commented Aug 23, 2014

Hello,

I don't get javacv to work on my android, despite following all instructions on how to install javacv..
(https://github.com/bytedeco/javacv#manual-installation-for-opencv-and-ffmpeg)

The first time I'm accessing the c++ API, this will happen:
java.lang.UnsatisfiedLinkError: Native method not found: org.bytedeco.javacpp.opencv_core$Mat.allocate:()

Are there any suggestions?

Thank you.

@saudet
Copy link
Member

saudet commented Aug 24, 2014

The ADT plugin for Eclipse is pretty buggy. Project files can easily get corrupted. Please try to recreate the project files from scratch.

@saudet saudet closed this as completed Aug 24, 2014
@chile12
Copy link
Author

chile12 commented Aug 24, 2014

The forth post of this issue discussion solved my problem:
https://code.google.com/p/javacv/issues/detail?id=459

Maybe this will help someone in the future, or solve this issue all together..

@saudet saudet added bug and removed question labels Aug 24, 2014
@saudet
Copy link
Member

saudet commented Aug 24, 2014

That's strange, I thought I had fixed that issue, since I didn't get any feedback from anyone:
bytedeco/javacpp#1 and #9
But it's still happening it seems. Guess we'll have to look back at that once more.

Thanks for the workaround, and please let me know if you figure out how to fix this, thanks!

@saudet saudet reopened this Aug 24, 2014
@jpsacha
Copy link
Member

jpsacha commented Sep 11, 2014

I got the same error if new Mat() is done early in a program, for instance:

import org.bytedeco.javacpp.opencv_core.*;

public class NewMatDemo {
    public static void main(String[] args) {
       Mat image = new Mat();
    }
}

Running above results in exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.opencv_core$Mat.allocate()V
    at org.bytedeco.javacpp.opencv_core$Mat.allocate(Native Method)
    at org.bytedeco.javacpp.opencv_core$Mat.<init>(opencv_core.java:6211)
    at org.bytedeco.javacpp.helper.opencv_core$AbstractMat.<clinit>(opencv_core.java:2376)
    at NewMatDemo.main(NewMatDemo.java:5)

However, if I do some other OpenCV function first, it will not happen, for instance:

import org.bytedeco.javacpp.opencv_core.Mat;
import static org.bytedeco.javacpp.opencv_highgui.imread;

public class NewMatDemo {
    public static void main(String[] args) {
        imread("data/church01.jpg");
        Mat image = new Mat();
    }
}

runs just fine.

I am running current build of javacv 2.4.9_0.9.1-SNAPSHOT.

saudet added a commit to bytedeco/javacpp-presets that referenced this issue Sep 15, 2014
@saudet
Copy link
Member

saudet commented Dec 27, 2014

Now it should be fixed in version 0.10. Let me know if you still encounter that issue for some reason, thanks!

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