-
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
Getting "java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil" although platform dependencies are included #109
Comments
The cause of that exception should be able to tell us what the issue is.
Could copy/paste the cause of that exception as well? Thanks
|
The cause of that Error seems to be null. |
It can't be a null error. So make sure that your dependancies are in the correct place in Android it And in Android Studio also they are same I think so. Hope it helps,
|
Let's see, it's probably caused by an old version of glibc: bytedeco/javacpp-presets#22 |
Aha, that seems probable. I will upgrade and come back if I'm still stuck. Thank you very much! ShihabSoft; the Error object and its cause are two different objects, so an Error object can very well have a null cause. And this hasn't anything to do with either Eclipse nor Android; it's a dynamic linking version mismatch, if the hypothesis is correct. |
Hey Lindal, If so are you getting a null pointer exception not so ha. You are getting a NoClassDefFoundError. And you are getting this stacktrace ,
Scenario At the time of initialization of avutil class. The org.bytedeco.javacpp.Loader tried to load the class avformat class in Try looking for the avformat class and make sure the avformat is the latest Check for some new classes are introduced in 0.10 version to the prior It all happens when the grabber.startUnsafe function is called. That may resolves your problem. And u r here to solve your problem. And we all together will find a better solution. Hope u understand, Aha, that seems probable. I will upgrade and come back if I'm still stuck. ShihabSoft; the Error object and its cause are two different objects, so an Reply to this email directly or view it on GitHub |
In case another Windows users runs into this: I was seeing the exact same error and stack trace (from FFmpegFrameGrabber on). Debugging the Loader.load method revealed that there was an unsatisfied link error that didn't show up in the error log:
I also found that adding a dependency on the org.bytedeco.javacpp-presets:ffmpeg artifact specific to my platform fixed it. I also had to add the org.bytedeco.javacpp-presets:opencv artifact. In retrospect, I just re-read the instructions, and found I'd missed a step. Oops.
|
Thank you very much, @saudet. That did the trick! |
Ok, good! Marking as a duplicate of: bytedeco/javacpp-presets#22 |
@ideastorm I've emphasized the last sentence in the |
@ideastorm or @saudet, I'm getting the same error, could any of you guys please explain me how to add the artifacts manually? (I'm using windows, maven and IntelliJ). Thanks a lot in advance!. |
@MarcoVCiotola You're under Windows, so GLIBC isn't the issue here. Could you use Dependency Walker on the DLLs and report what seems to be the problem? Thanks! |
Hi @saudet , I've run Dependency Walker on avutil.dll and it says that API-MS-WIN-SERVICE-PRIVATE-L1-1-1.DLL, API-MS-WIN-CORE-KERNEL32-PRIVATE-L1-1-1.DLL and API-MS-WIN-CORE-PRIVATEPROFILE-L1-1-1.DLL are missing; but I google those libraries and found that some peolple had the same issue, but most of the times they were not related to those libraries and that the problem lies entirely elsewhere. In this case @ideastorm solve it by adding the artifacts manually, my problem is that I don't know hot to do it :(. If you could be so kind to explain me how to do it I really apreciate it a lot!!. Thanks again for responding even though the issue is closed (I've realized after I posted the question) |
That sounds like Dependency Walker is failing as well... The missing dependency is something else. |
Hi guys, I am getting the same error with a Raspberry Pi. I'm not exactly sure how to add the platform-specific artifacts manually. I added the org.bytedeco.javacpp-presets:ffmpeg and org.bytedeco.javacpp-presets:opencv to no avail. |
增加下面的包
|
I've tried to run a simple application with an FFMmpegFrameGrabber.
I've included javacv 0.10 in my pom and ran the
$ mvn package exec:java -Dplatform.dependencies -Dexec.mainClass=<fqdn to my class>
However, I get this error:
java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:266)
at org.bytedeco.javacpp.Loader.load(Loader.java:385)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.avformat$AVFormatContext.(avformat.java:2249)
at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:346)
at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:340)
I also tried to build an uber jar and checked that avutil.class actually resided in the jar. Same error.
I run Debian Squeeze kernel 3.2.0.
Any idea, anyone?
The text was updated successfully, but these errors were encountered: