mp4parser icon indicating copy to clipboard operation
mp4parser copied to clipboard

java.lang.NoSuchMethodError when creating new IsoFile

Open TonyXu09 opened this issue 6 years ago • 16 comments

I am getting a crash when trying to create an IsoFile. I am running Android and java jdk 1.8.0_121

java.lang.NoSuchMethodError: No virtual method rewind()Ljava/nio/ByteBuffer; in class Ljava/nio/ByteBuffer; or its super classes (declaration of 'java.nio.ByteBuffer' appears in /system/framework/core-oj.jar) at org.mp4parser.AbstractBoxParser.parseBox(AbstractBoxParser.java:56) at org.mp4parser.BasicContainer.initContainer(BasicContainer.java:107) at org.mp4parser.IsoFile.<init>(IsoFile.java:57) at org.mp4parser.IsoFile.<init>(IsoFile.java:44)

That is my crash.

Is there a particular jdk that I should be using? This was working fine before when I was using build 1.9.27

TonyXu09 avatar Aug 03 '18 18:08 TonyXu09

I got the same problem with latest 1.9.37 on Android. No issue on 1.9.36 via maven repository.

java.lang.NoSuchMethodError: No virtual method rewind()Ljava/nio/ByteBuffer; in class Ljava/nio/ByteBuffer; or its super classes (declaration of 'java.nio.ByteBuffer' appears in /system/framework/core-oj.jar)
        at org.mp4parser.support.AbstractBox.getBox(AbstractBox.java:120)
        at org.telegram.messenger.video.MP4Builder.createMovie(MP4Builder.java:71)

If I put the latest isoparser source code directly into the project and compile, everything is ok (no crash).

Could be an issue with a build for maven repository?

alexeyvasilyev avatar Aug 03 '18 20:08 alexeyvasilyev

I accidentally built 1.9.37 with Java 9 I believe. I will rebuilt with Java 8 in the next days and push a new version to central.

alexeyvasilyev [email protected] schrieb am Fr., 3. Aug. 2018, 22:22:

I got the same problem with latest 1.9.37 on Android. No issue on 1.9.36 via maven repository.

java.lang.NoSuchMethodError: No virtual method rewind()Ljava/nio/ByteBuffer; in class Ljava/nio/ByteBuffer; or its super classes (declaration of 'java.nio.ByteBuffer' appears in /system/framework/core-oj.jar)
    at org.mp4parser.support.AbstractBox.getBox(AbstractBox.java:120)
    at org.telegram.messenger.video.MP4Builder.createMovie(MP4Builder.java:71)

If I put the latest isoparser source code directly into the project and compile, everything is ok (no crash).

Could be an issue with a build for maven repository?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sannies/mp4parser/issues/323#issuecomment-410366214, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKUD-elF7X0imy8cFQQ5JGGYtbfVFFNks5uNLDsgaJpZM4VuZ-W .

sannies avatar Aug 04 '18 05:08 sannies

any news on that?

eraycantazeguney avatar Aug 28 '18 12:08 eraycantazeguney

Issue still not fixed. sannies, please fix that. 1.9.37 is completely unusable on Android.

alexeyvasilyev avatar Oct 22 '18 17:10 alexeyvasilyev

I accidentally built 1.9.37 with Java 9 I believe. I will rebuilt with Java 8 in the next days and push a new version to central. alexeyvasilyev [email protected] schrieb am Fr., 3. Aug. 2018, 22:22: I got the same problem with latest 1.9.37 on Android. No issue on 1.9.36 via maven repository. java.lang.NoSuchMethodError: No virtual method rewind()Ljava/nio/ByteBuffer; in class Ljava/nio/ByteBuffer; or its super classes (declaration of 'java.nio.ByteBuffer' appears in /system/framework/core-oj.jar) at org.mp4parser.support.AbstractBox.getBox(AbstractBox.java:120) at org.telegram.messenger.video.MP4Builder.createMovie(MP4Builder.java:71) If I put the latest isoparser source code directly into the project and compile, everything is ok (no crash). Could be an issue with a build for maven repository? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#323 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKUD-elF7X0imy8cFQQ5JGGYtbfVFFNks5uNLDsgaJpZM4VuZ-W .

Can you please push version 1.9.37 java 8? It's useless at the moment. Thank you.

x011 avatar Nov 16 '18 01:11 x011

Problem appears to be that the library was built with a JDK > java 8. Even with compatibility mode set lower the problem is still there. Please compile with JDK 8 or lower or cast as described in the following bug.
https://github.com/apache/felix/pull/114

TheFarmer1 avatar Jan 08 '19 16:01 TheFarmer1

Any news on this @sannies ? A new build with java 8 would be greatly appreciated.

irenius avatar Jan 13 '19 21:01 irenius

Looks like @sannies does not care anymore about this project.

alexeyvasilyev avatar Jan 14 '19 10:01 alexeyvasilyev

Any ideas if this issue has been fixed yet?

davidnir1 avatar Mar 24 '19 20:03 davidnir1

@sannies The same problem arises with the new published version 1.9.38

talklittle avatar May 10 '19 00:05 talklittle

@sannies Older versions has the OutOfMemoryError issue and 1.9.37/1.9.38 has this issue. Currently, this library is completely unusable for Android developers.

Can you please let us know if you are going to fix this and if not, how can we fix it ourselves?

ANY feedback would be appreciated.

HBiSoft avatar May 10 '19 05:05 HBiSoft

@sannies

After reading more about this - You can cast ByteBuffer to Buffer then you can compile the project with JDK9 and have it running on JDK8.

HBiSoft avatar May 11 '19 10:05 HBiSoft

This issue appears fixed with version 1.9.41 thanks to commit 0fdd054d7cd65b0328ec685e0e8ac20a16216fe6

Thank you @sannies ! :tada:
And @HBiSoft for pointing out the potential solution.

talklittle avatar Sep 28 '19 20:09 talklittle

I'm facing this issue still with 1.9.41 on Android

kerimovscreations avatar Dec 18 '19 16:12 kerimovscreations

@kerimovscreations This is probably because you are not using JDK8. You should implement it in your project, have a look here - https://developer.android.com/studio/write/java8-support

HBiSoft avatar Jan 27 '20 10:01 HBiSoft

@YitianTonyXu Please close this issue. It is fixed.

HBiSoft avatar Jan 27 '20 10:01 HBiSoft