Adding a library as JAR to Jitsi Android

Hey guys,

currently I try to include a library as local Jar file into the Jitsi Meet android application.
Using a normal Android Application (created out of Android Studio) works fine by adding a
compileOnly files(‘gslibs/gsapi-1.1.11.jar’) to the dependencies. But in Jitsi’s react native environment I get dependency resolution errors.

Probably unnecessary details

  • aim is to implement a drop down menu to select the user from a system-known list (using this library) when joining a conference (aim system are telephony devices of Grandstream)

What I did:

  • Adding the dependency to build.gradle (:app) as mentioned above
  • calling the library in MainActivity.java

==> Android Studio IDE does not give me any errors at this point but after trying to deploy it onto real
devices (via usb session as well as via apk) there is the following error (see bottom).

My question: How can I fix that respectively which files do you need to see in order to give hints?

Thanks in advance!

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.jitsi.meet, PID: 27028
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/gs/common/client/ApiClient;
        at org.jitsi.meet.MainActivity.onCreate(MainActivity.java:88)
        at android.app.Activity.performCreate(Activity.java:7458)
        at android.app.Activity.performCreate(Activity.java:7448)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
        at android.os.Handler.dispatchMessage(Handler.java:112)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7625)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.gs.common.client.ApiClient" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/org.jitsi.meet-IGhKno78W7qBFH-wTlVE6Q==/base.apk"],nativeLibraryDirectories=[/data/app/org.jitsi.meet-IGhKno78W7qBFH-wTlVE6Q==/lib/arm64, /data/app/org.jitsi.meet-IGhKno78W7qBFH-wTlVE6Q==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64, /prets/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at org.jitsi.meet.MainActivity.onCreate(MainActivity.java:88) 
        at android.app.Activity.performCreate(Activity.java:7458) 
        at android.app.Activity.performCreate(Activity.java:7448) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) 
        at android.os.Handler.dispatchMessage(Handler.java:112) 
        at android.os.Looper.loop(Looper.java:216) 
        at android.app.ActivityThread.main(ActivityThread.java:7625) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987) 
E/JitsiMeetSDK: JitsiMeetUncaughtExceptionHandler FATAL ERROR
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/gs/common/client/ApiClient;
        at org.jitsi.meet.MainActivity.onCreate(MainActivity.java:88)
        at android.app.Activity.performCreate(Activity.java:7458)
        at android.app.Activity.performCreate(Activity.java:7448)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
        at android.os.Handler.dispatchMessage(Handler.java:112)
        at android.os.Looper.loop(Looper.java:216)
        at android.app.ActivityThread.main(ActivityThread.java:7625)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.gs.common.client.ApiClient" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/org.jitsi.meet-IGhKno78W7qBFH-wTlVE6Q==/base.apk"],nativeLibraryDirectories=[/data/app/org.jitsi.meet-IGhKno78W7qBFH-wTlVE6Q==/lib/arm64, /data/app/org.jitsi.meet-IGhKno78W7qBFH-wTlVE6Q==/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64, /prets/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at org.jitsi.meet.MainActivity.onCreate(MainActivity.java:88) 
        at android.app.Activity.performCreate(Activity.java:7458) 
        at android.app.Activity.performCreate(Activity.java:7448) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199) 
        at android.os.Handler.dispatchMessage(Handler.java:112) 
        at android.os.Looper.loop(Looper.java:216) 
        at android.app.ActivityThread.main(ActivityThread.java:7625) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)