Android App with Jitsi SDK- Classes for Webrtc are not found

I have integrated Android SDK 2.2.2. After updating Javascript files I have kept index.android.bundle in the assets folder. It was working all good.

It suddenly throwing an exception in Generated Build file(Release or Debug.)

JS classes related to com.oney.WebRTCModule are not been loaded while running app application in Debug and Release variant or something else went wrong, Not sure what and where?

Is there any workaround for this? I have added crash log from crashlytics below,

Fatal Exception: java.lang.NoSuchMethodError: No static method createEgl14([I)Lorg/webrtc/EglBase; in class Lorg/webrtc/EglBase; or its super classes (declaration of 'org.webrtc.EglBase' appears in base.apk!classes3.dex)
       at com.oney.WebRTCModule.EglUtils.getRootEglBase + 35(EglUtils.java:35)
       at com.oney.WebRTCModule.EglUtils.getRootEglBaseContext + 62(EglUtils.java:62)
       at com.oney.WebRTCModule.WebRTCModule.initAsync + 57(WebRTCModule.java:57)
       at com.oney.WebRTCModule.WebRTCModule.lambda$new$0$WebRTCModule + 47(WebRTCModule.java:47)
       at com.oney.WebRTCModule.-$$Lambda$WebRTCModule$T9WIHBBwOXq3znC0jdgs3RSomME.run + 2(:2)
       at java.util.concurrent.ThreadPoolExecutor.runWorker + 1167(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run + 641(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run + 764(Thread.java:764)

I have even tried your demo project, Seems that is also not working. Not sure what is the exact issue as there is no way that classes get skipped/

Also, I have created one demo based on the integration of JitsiMeet android Maven Dependency v2.+
The demo is also crashing. Just try for release or debug build generation.

Could anyone please help me with this.

I have checked again and now its even stopped working when i run directly to the phone or simulator.
It is crashing with the same error as mentioned, Static method for createEgl14 is not found.

com.oney.WebRTCModule - createEgl14.

UncaughtException: java.lang.NoSuchMethodError: No static method createEgl14([I)Lorg/webrtc/EglBase; in class Lorg/webrtc/EglBase; or its super classes (declaration of 'org.webrtc.EglBase' appears in /data/app/com.app.Immerch-JRV3fGFdGgAfpbXEOWLNtQ==/base.apk!classes3.dex)

Finally i found the real culprit from the Github issue, I had updated the Android Studio from 3.4 to 3.5 and thats what causing the issue. Never had though of this before.

With Android Studio updates Gradle Version is also been updated to 5.4.1.

Workaround for this issue, Just downgrade the version of Gradle Plugin to 3.4.2 currently it might be using 3.5.+ in Android Studio from module settings.

Also, Change the Gradle version to 5.1.1 from 5.4.1.

2 Likes

correct answer, thank’s

Even though no one help you but you still update the answer for us, that so nice of you. thanks

Just signed up to say thank you! This is the fix and should be noted in the README.

A little more detail:

In the following file: android/build.gradle change the gradle build version to 3.4.2, e.g. classpath("com.android.tools.build:gradle:3.4.2")

In the properties file: android/gradle/wrapper/gradle-wrapper.properties change the gradle version to 5.1.1, e.g. distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

Clean and re-build!