saibotma / jitsi_meet_wrapper

Jitsi Meet Plugin for Flutter. Wrapping JitsiMeetSDK for Android and iOS.
BSD 3-Clause "New" or "Revised" License
28 stars 61 forks source link

ClassNotFoundException: Didn't find class "com.oblador.performance.StartTimeProvider" #112

Open riteshakya037 opened 1 year ago

riteshakya037 commented 1 year ago

I'm running into a problem when trying to add this library into my project.

E/AndroidRuntime(17425): java.lang.RuntimeException: Unable to get provider com.oblador.performance.StartTimeProvider: java.lang.ClassNotFoundException: Didn't find class "com.oblador.performance.StartTimeProvider" on path: DexPathList[[zip file "/data/app/nMxs153_VYNYAkrp5uTW8g==/ai.cerulearn.debug-FedVJ4j52pJvHHXu6QsbnA==/base.apk"],nativeLibraryDirectories=[/data/app/nMxs153_VYNYAkrp5uTW8g==/ai.cerulearn.debug-FedVJ4j52pJvHHXu6QsbnA==/lib/arm64, /data/app/~~nMxs153_VYNYAkrp5uTW8g==/ai.cerulearn.debug-FedVJ4j52pJvHHXu6QsbnA==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] E/AndroidRuntime(17425): at android.app.ActivityThread.installProvider(ActivityThread.java:7493) E/AndroidRuntime(17425): at android.app.ActivityThread.installContentProviders(ActivityThread.java:6999) E/AndroidRuntime(17425): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6770) E/AndroidRuntime(17425): at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) E/AndroidRuntime(17425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134) E/AndroidRuntime(17425): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime(17425): at android.os.Looper.loopOnce(Looper.java:201) E/AndroidRuntime(17425): at android.os.Looper.loop(Looper.java:288) E/AndroidRuntime(17425): at android.app.ActivityThread.main(ActivityThread.java:7898) E/AndroidRuntime(17425): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(17425): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) E/AndroidRuntime(17425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) E/AndroidRuntime(17425): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.oblador.performance.StartTimeProvider" on path: DexPathList[[zip file "/data/app/nMxs153_VYNYAkrp5uTW8g==/ai.cerulearn.debug-FedVJ4j52pJvHHXu6QsbnA==/base.apk"],nativeLibraryDirectories=[/data/app/nMxs153_VYNYAkrp5uTW8g==/ai.cerulearn.debug-FedVJ4j52pJvHHXu6QsbnA==/lib/arm64, /data/app/~~nMxs153_VYNYAkrp5uTW8g==/ai.cerulearn.debug-FedVJ4j52pJvHHXu6QsbnA==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]] E/AndroidRuntime(17425): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259) E/AndroidRuntime(17425): at java.lang.ClassLoader.loadClass(ClassLoader.java:379) E/AndroidRuntime(17425): at java.lang.ClassLoader.loadClass(ClassLoader.java:312) E/AndroidRuntime(17425): at android.app.AppComponentFactory.instantiateProvider(AppComponentFactory.java:147) E/AndroidRuntime(17425): at androidx.core.app.CoreComponentFactory.instantiateProvider(CoreComponentFactory.java:67) E/AndroidRuntime(17425): at android.app.ActivityThread.installProvider(ActivityThread.java:7477) E/AndroidRuntime(17425): ... 11 more

RealSarkhan commented 1 year ago

I have the same issue, it happens in every sdk versions after 7.0.1 Note: I'm trying to use the sdk in flutter plugin.

saibotma commented 1 year ago

Please try the newest version. If it still does not work, please provide a fully reproducible example.

RealSerkhan commented 1 year ago

@saibotma I tested on the latest version, I'm getting the same result. My android version is 13. and getting the exactly the same error with @riteshakya037 shared

saibotma commented 1 year ago

Please share a reproducible example.

riteshakya037 commented 1 year ago

@RealSarkhan @saibotma I apologize for the delay in my response. I was away and didn't have a chance to reply earlier.

Regarding the issue, a solution that worked for me was copying the ProGuard rules from the given link and adding the ProGuard file to the release mode in the app/build.gradle file. Not really sure why that would work for the debug version of the app as well.

android {
    // ...
    buildTypes {
        // ...
        release {
            // ...
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

If you have any further questions or need additional assistance, please let me know. I'm here to help!

raulsuro commented 1 year ago

Hello @RealSarkhan and @riteshakya037 I am facing the same issue and the solution you propose is not working on my case. I have tried with multiple versions after 7.0.1 and adding different configurations to the Proguard file but still getting:

java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.d: java.lang.ClassNotFoundException: org.jitsi.meet.sdk.JitsiInitializer

niravkakadiya25 commented 1 year ago

Hello @saibotma @riteshakya037 This issue is working for me. just update the classpath of the project.

project-level build Gradle:- classpath 'com.android.tools.build:gradle:7.1.2'

raulsuro commented 1 year ago

Thanks! @niravkakadiya25 I could make it run without crashes now I am just trying to join a meeting and I am getting this error:


 E  Failed to set cxx error hanlder function
                 java.lang.NoSuchMethodException: a6.i.handleCxxError [class java.lang.Exception]
                    at java.lang.Class.getMethod(Class.java:2103)
                    at java.lang.Class.getMethod(Class.java:1724)
                    at a6.i.d0(:391)
                    at a6.i.<init>(:304)
                    at a6.k.b(:358)
                    at org.jitsi.meet.sdk.ReactInstanceManagerHolder.initReactInstanceManager(:256)
                    at org.jitsi.meet.sdk.JitsiMeetView.initialize(:202)
                    at org.jitsi.meet.sdk.JitsiMeetView.<init>(:103)
                    at java.lang.reflect.Constructor.newInstance0(Native Method)
                    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
                    at android.view.LayoutInflater.createView(LayoutInflater.java:858)
                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
                    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)
                    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:485)
                    at e.e.B(:706)
                    at androidx.appcompat.app.b.setContentView(:195)
                    at org.jitsi.meet.sdk.JitsiMeetActivity.onCreate(:103)```

                    but I guess this is not related. 
                    Thanks again!
niravkakadiya25 commented 1 year ago

can you share join meeting code as well?

raulsuro commented 1 year ago

sure @niravkakadiya25 :

   private fun joinMeeting(call: MethodCall, result: Result) {
//        val room = call.argument<String>("room")
        val room="eff9383f-afd6-41a3-ae17-d13d12747a28"

//        if (room.isNullOrBlank()) {
//            result.error("400",
//                    "room can not be null or empty",
//                    "room can not be null or empty")
//            return
//        }

        Log.d(JITSI_PLUGIN_TAG, "Joining Room: $room")

        val bundle = Bundle()
        bundle.putString("displayName", call.argument("sstudent46@yopmail.com"))
        bundle.putString("email", call.argument("sstudent46@yopmail.com"))
//        userInfo.displayName = call.argument("sstudent46@yopmail.com")
//        userInfo.email = call.argument("sstudent46@yopmail.com")
        if (call.argument<String?>("userAvatarURL") != null) {
            bundle.putString("avatarURL", call.argument("userAvatarURL"))

//            userInfo.avatar = URL(call.argument("userAvatarURL"))
        }
        Log.i("JitsiMeetPlugin", "--joinMeeting: ${jitsiInitializer.toString()}")
        val userInfo = JitsiMeetUserInfo(bundle)

//        var serverURLString = call.argument<String>("serverURL")
        var serverURLString="https://jitsi.dev.cratieadvth.ml"
        if (serverURLString == null) {
            serverURLString = "https://meet.jit.si";
        }
        val serverURL = URL(serverURLString)
        Log.d(JITSI_PLUGIN_TAG, "Server URL: $serverURL, $serverURLString")

        val optionsBuilder = JitsiMeetConferenceOptions.Builder()

        // Set meeting options
        optionsBuilder
                .setServerURL(serverURL)
                .setRoom(room)
                .setSubject(call.argument("subject"))
                .setToken("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb250ZXh0Ijp7InVzZXIiOnsibmFtZSI6InNzdHVkZW50NEB5b3BtYWlsLmNvbSIsImVtYWlsIjoic3N0dWRlbnQ0QHlvcG1haWwuY29tIiwiYWZmaWxpYXRpb24iOiJtZW1iZXIifX0sInN1YiI6Imh0dHBzOi8vaml0c2kuZGV2LmNyZWF0aXZlYWR2dGVjaC5tbCIsImlzcyI6InRhM2xlZW1lZHhhcHAiLCJhdWQiOiJ0YTNsZWVtZWR4YXBwIiwicm9vbSI6ImJmZmYwZDc0LWQzNmMtNGRjZC1hZmM3LWVhNWM5ZmVkZDM1ZSIsImlhdCI6MTY4NjEzMDA4N30.Mx-lOWMghL_NNHn9WuJebovyCdeIOQ94z_gGQ"
                )
                .setAudioMuted(call.argument("audioMuted") ?: false)
                .setAudioOnly(call.argument("audioOnly") ?: false)
                .setVideoMuted(call.argument("videoMuted") ?: false)
                .setUserInfo(userInfo)

        // Add feature flags into options, reading given Map
        if (call.argument<HashMap<String, Any>?>("featureFlags") != null) {
            val featureFlags = call.argument<HashMap<String, Any>>("featureFlags")
            featureFlags!!.forEach { (key, value) ->
                if (value is Boolean) {
                    val boolVal = value.toString().toBoolean()
                    optionsBuilder.setFeatureFlag(key, boolVal)
                } else {
                    val intVal = value.toString().toInt()
                    optionsBuilder.setFeatureFlag(key, intVal)
                }
            }
        }

        // Build with meeting options and feature flags
        val options = optionsBuilder.build()

        JitsiMeetPluginActivity.launchActivity(activity, options)
        result.success("Successfully joined room: $room")
    }
niravkakadiya25 commented 1 year ago

have you added proguards and multidex? @raulsuro

raulsuro commented 1 year ago

Yes @niravkakadiya25 proguard adding all related to jitsi: -keep class org.jitsi.meet.** { *; } -keep class org.jitsi.meet.sdk.** { *; }

and enabled multidex Still getting the same error after joining meeting I can see the room but then when I finally try to join it gives me that error

niravkakadiya25 commented 1 year ago

https://we.tl/t-80GoxMb7GE

use this proguards @raulsuro

raulsuro commented 1 year ago

@niravkakadiya25 thanks but I am still getting the same error. Could be proguard or maybe some library that needs update. Still investigating

Actually I can bypass that error and then when I select the user and the audio/video options and tap on Join Meeting I don't get the same just this:

Cmdline: com.gunschu.jitsi_meet_example
  A  pid: 8431, tid: 8532, name: mqt_js  >>> com.gunschu.jitsi_meet_example <<<
  A        #00 pc 00000000002cb6a8  /data/app/~~cL2C4Wa3Vun_TCJrgr8Ukg==/com.gunschu.jitsi_meet_example-9Rx_AXV-GIxlxBgZ5xijCA==/base.apk!libjsc.so (BuildId: dad225e5c5aafb43e3fcbfcd576772a6a0f8c19a)
  A        #01 pc 00000000002cb480  /data/app/~~cL2C4Wa3Vun_TCJrgr8Ukg==/com.gunschu.jitsi_meet_example-9Rx_AXV-GIxlxBgZ5xijCA==/base.apk!libjsc.so (BuildId: dad225e5c5aafb43e3fcbfcd576772a6a0f8c19a)       
niravkakadiya25 commented 1 year ago

I think you need to use latest version of jitsee @raulsuro

raulsuro commented 1 year ago

I am using this one:

implementation ('org.jitsi.react:jitsi-meet-sdk:8.1.2') { transitive = true }
Actually these issues started when I updated to the latest version. @niravkakadiya25