Jitsi Android SDK Crash

Hello Experts and wish you a very happy 2023!.

I’m running into an error ONLY ON API 9 and BELOW wherein I see a run-time crash in an app that embeds the Android SDK (SDK is built from source, version 6.2.2). Below is logcat output that is specific to the crash:

2023-01-03 08:57:56.985 21416-22124/ E/AndroidRuntime: FATAL EXCEPTION: pool-40-thread-1
Process: , PID: 21416
java.lang.NoSuchMethodError: No virtual method position(I)Ljava/nio/FloatBuffer; in class Ljava/nio/FloatBuffer; or its super classes (declaration of ‘java.nio.FloatBuffer’ appears in /system/framework/core-oj.jar)
at org.webrtc.GlUtil.createFloatBuffer(GlUtil.java:47)
at org.webrtc.GlGenericDrawer.(GlGenericDrawer.java:75)
at org.webrtc.YuvConverter.(YuvConverter.java:111)
at org.webrtc.YuvConverter.(YuvConverter.java:118)
at org.webrtc.SurfaceTextureHelper.create(SurfaceTextureHelper.java:92)
at com.oney.WebRTCModule.GetUserMediaImpl.createVideoTrack(GetUserMediaImpl.java:372)
at com.oney.WebRTCModule.GetUserMediaImpl.getUserMedia(GetUserMediaImpl.java:202)
at com.oney.WebRTCModule.WebRTCModule.lambda$getUserMedia$3$WebRTCModule(WebRTCModule.java:494)
at com.oney.WebRTCModule.-$$Lambda$WebRTCModule$0qkZibMzcY8Pwtjjc0Lt3Ovz8Z8.run(Unknown Source:8)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
2023-01-03 08:57:56.994 21416-22124/ E/JitsiMeetSDK: JitsiMeetUncaughtExceptionHandler FATAL ERROR
java.lang.NoSuchMethodError: No virtual method position(I)Ljava/nio/FloatBuffer; in class Ljava/nio/FloatBuffer; or its super classes (declaration of ‘java.nio.FloatBuffer’ appears in /system/framework/core-oj.jar)
at org.webrtc.GlUtil.createFloatBuffer(GlUtil.java:47)
at org.webrtc.GlGenericDrawer.(GlGenericDrawer.java:75)
at org.webrtc.YuvConverter.(YuvConverter.java:111)
at org.webrtc.YuvConverter.(YuvConverter.java:118)
at org.webrtc.SurfaceTextureHelper.create(SurfaceTextureHelper.java:92)
at com.oney.WebRTCModule.GetUserMediaImpl.createVideoTrack(GetUserMediaImpl.java:372)
at com.oney.WebRTCModule.GetUserMediaImpl.getUserMedia(GetUserMediaImpl.java:202)
at com.oney.WebRTCModule.WebRTCModule.lambda$getUserMedia$3$WebRTCModule(WebRTCModule.java:494)
at com.oney.WebRTCModule.-$$Lambda$WebRTCModule$0qkZibMzcY8Pwtjjc0Lt3Ovz8Z8.run(Unknown Source:8)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

java.lang.NoSuchMethodError: No virtual method position(I)Ljava/nio/FloatBuffer; in class Ljava/nio/FloatBuffer; or its super classes (declaration of 'java.nio.FloatBuffer' appears in /system/framework/core-oj.jar)
    at org.webrtc.GlUtil.createFloatBuffer(GlUtil.java:47)
    at org.webrtc.GlGenericDrawer.<clinit>(GlGenericDrawer.java:75)
    at org.webrtc.YuvConverter.<init>(YuvConverter.java:111)
    at org.webrtc.YuvConverter.<init>(YuvConverter.java:118)
    at org.webrtc.SurfaceTextureHelper.create(SurfaceTextureHelper.java:92)
    at com.oney.WebRTCModule.GetUserMediaImpl.createVideoTrack(GetUserMediaImpl.java:372)
    at com.oney.WebRTCModule.GetUserMediaImpl.getUserMedia(GetUserMediaImpl.java:202)
    at com.oney.WebRTCModule.WebRTCModule.lambda$getUserMedia$3$WebRTCModule(WebRTCModule.java:494)
    at com.oney.WebRTCModule.-$$Lambda$WebRTCModule$0qkZibMzcY8Pwtjjc0Lt3Ovz8Z8.run(Unknown Source:8)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)

I see guidance for adding the following to fix the error:

android.enableDexingArtifactTransform.desugaring=false to the gradle.properties file

However, it doesn’t seem to work.

The above errors seem to be related to the following:

I noticed that files of libwebrtc are compiled using Java11, perhaps that is the source of the issue?
Any help would be greatly appreciated.

Thanks!

try it like this
downgrading jitsi to 1.16.0
I’m waiting for your answer

Thanks for the revert, version 1.16.0 refers to the JITSI SDK version?

yes

Thanks again. Yeah, I’v tried different versions - they all work until the react-native-webrtc version of the SDK is 1.100.1. Any SDK that I’m building that has the react-native-webrtc version set to 1.106.1 in the package.json and that is deployed on a device <= Android 9, I get the error. As mentioned in the initial write up, the issue seems to be with the way Java 9 and beyond handle Buffers.