Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when e2ee is enabled #541

Open
Suosuo123 opened this issue Nov 14, 2024 · 5 comments
Open

Crash when e2ee is enabled #541

Suosuo123 opened this issue Nov 14, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@Suosuo123
Copy link

      Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for livekit.org.webrtc.FrameCryptorKeyProvider livekit.org.webrtc.FrameCryptorFactory.nativeCreateFrameCryptorKeyProvider(boolean, byte[], int, byte[], int, int, boolean) (tried Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider and Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider__Z_3BI_3BIIZ) - is the library loaded, e.g. System.loadLibrary?
   at livekit.org.webrtc.FrameCryptorFactory.nativeCreateFrameCryptorKeyProvider(FrameCryptorFactory.java)
   at livekit.org.webrtc.FrameCryptorFactory.createFrameCryptorKeyProvider(FrameCryptorFactory.java:22)
   at io.livekit.android.e2ee.BaseKeyProvider.<init>(KeyProvider.kt:107)
   at io.livekit.android.e2ee.E2EEOptions.<init>(E2EEOptions.kt:30)
   at com.difft.android.meeting.CallViewModel.getE2EEOptions(CallViewModel.kt:63)
   at com.difft.android.meeting.CallViewModel.getRoomOptions(CallViewModel.kt:73)
   at com.difft.android.meeting.CallViewModel.<init>(CallViewModel.kt:79)
   at com.difft.android.meeting.CallViewModel.<init>(CallViewModel.kt:50)
   at com.difft.android.meeting.CallActivity$viewModel$2.invoke(CallActivity.kt:86)
   at com.difft.android.meeting.CallActivity$viewModel$2.invoke(CallActivity.kt:83)
   at com.difft.android.meeting.ViewModelLazyExtKt$createViewModelFactoryFactory$1.create(ViewModelLazyExt.kt:24)
   at androidx.lifecycle.ViewModelProvider$Factory$-CC.$default$create(ViewModelProvider.android.kt:153)
   at com.difft.android.meeting.ViewModelLazyExtKt$createViewModelFactoryFactory$1.create()
   at androidx.lifecycle.ViewModelProvider$Factory$-CC.$default$create(ViewModelProvider.android.kt:158)
   at com.difft.android.meeting.ViewModelLazyExtKt$createViewModelFactoryFactory$1.create()
   at androidx.lifecycle.viewmodel.ViewModelProviderImpl_androidKt.createViewModel(ViewModelProviderImpl.android.kt:34)
   at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release(ViewModelProviderImpl.kt:65)
   at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release$default(ViewModelProviderImpl.kt:47)
   at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.android.kt:91)
   at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:51)
   at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:35)
   at com.difft.android.meeting.CallActivity.getViewModel(CallActivity.kt:83)
   at com.difft.android.meeting.CallActivity.access$getViewModel(CallActivity.kt:81)
   at com.difft.android.meeting.CallActivity$onResume$1.invokeSuspend(CallActivity.kt:146)
   at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
   at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
   at androidx.lifecycle.DispatchQueue.drainQueue(DispatchQueue.jvm.kt:74)
   at androidx.lifecycle.DispatchQueue.resume(DispatchQueue.jvm.kt:53)
   at androidx.lifecycle.LifecycleController.observer$lambda$0(LifecycleController.jvm.kt:40)
   at androidx.lifecycle.LifecycleController.$r8$lambda$INWMOb0xmlhb_ycZo7uXu7mUdSw()
   at androidx.lifecycle.LifecycleController$$ExternalSyntheticLambda0.onStateChanged(:4)
   at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:320)
   at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.jvm.kt:257)
   at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.jvm.kt:293)
   at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.jvm.kt:142)
   at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.jvm.kt:124)
   at androidx.lifecycle.ReportFragment$Companion.dispatch$lifecycle_runtime_release(ReportFragment.android.kt:190)
   at androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPostResumed(ReportFragment.android.kt:125)
   at android.app.Activity.dispatchActivityPostResumed(Activity.java:1592)
   at android.app.Activity.performResume(Activity.java:9151)
   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5234)
   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5277)
   at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
   at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:60)
   at android.app.servertransaction.TransactionExecutor.executeLifecycleItem(TransactionExecutor.java:282)
   at android.app.servertransaction.TransactionExecutor.executeTransactionItems(TransactionExecutor.java:150)
   at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:93)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2595)
   at android.os.Handler.dispatchMessage(Handler.java:107)
   at android.os.Looper.loopOnce(Looper.java:232)
   at android.os.Looper.loop(Looper.java:317)
   at android.app.ActivityThread.main(ActivityThread.java:8592)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
@Suosuo123 Suosuo123 added the bug Something isn't working label Nov 14, 2024
@Suosuo123
Copy link
Author

This problem only occurs in the sample-app-compose project. Sample-app is normal.

@tamimattafi
Copy link

Having the same issue with sample-app-compose

---------------------------- PROCESS STARTED (7831) for package io.livekit.android.composesample ----------------------------
No implementation found for livekit.org.webrtc.FrameCryptorKeyProvider livekit.org.webrtc.FrameCryptorFactory.nativeCreateFrameCryptorKeyProvider(boolean, byte[], int, byte[], int, int, boolean) (tried Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider and Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider__Z_3BI_3BIIZ) - is the library loaded, e.g. System.loadLibrary?
No implementation found for livekit.org.webrtc.FrameCryptorKeyProvider livekit.org.webrtc.FrameCryptorFactory.nativeCreateFrameCryptorKeyProvider(boolean, byte[], int, byte[], int, int, boolean) (tried Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider and Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider__Z_3BI_3BIIZ) - is the library loaded, e.g. System.loadLibrary?
FATAL EXCEPTION: main
Process: io.livekit.android.composesample, PID: 7831
java.lang.UnsatisfiedLinkError: No implementation found for livekit.org.webrtc.FrameCryptorKeyProvider livekit.org.webrtc.FrameCryptorFactory.nativeCreateFrameCryptorKeyProvider(boolean, byte[], int, byte[], int, int, boolean) (tried Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider and Java_livekit_org_webrtc_FrameCryptorFactory_nativeCreateFrameCryptorKeyProvider__Z_3BI_3BIIZ) - is the library loaded, e.g. System.loadLibrary?
	at livekit.org.webrtc.FrameCryptorFactory.nativeCreateFrameCryptorKeyProvider(Native Method)
	at livekit.org.webrtc.FrameCryptorFactory.createFrameCryptorKeyProvider(FrameCryptorFactory.java:22)
	at io.livekit.android.e2ee.BaseKeyProvider.<init>(KeyProvider.kt:107)
	at io.livekit.android.e2ee.E2EEOptions.<init>(E2EEOptions.kt:30)
	at io.livekit.android.sample.CallViewModel.getE2EEOptions(CallViewModel.kt:84)
	at io.livekit.android.sample.CallViewModel.getRoomOptions(CallViewModel.kt:94)
	at io.livekit.android.sample.CallViewModel.<init>(CallViewModel.kt:100)
	at io.livekit.android.sample.CallViewModel.<init>(CallViewModel.kt:71)
	at io.livekit.android.composesample.CallActivity$viewModel$2.invoke(CallActivity.kt:88)
	at io.livekit.android.composesample.CallActivity$viewModel$2.invoke(CallActivity.kt:85)
	at io.livekit.android.composesample.ViewModelLazyExtKt$createViewModelFactoryFactory$1.create(ViewModelLazyExt.kt:24)
	at androidx.lifecycle.ViewModelProvider$Factory.create(ViewModelProvider.android.kt:153)
	at androidx.lifecycle.ViewModelProvider$Factory.create(ViewModelProvider.android.kt:158)
	at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release(ViewModelProviderImpl.kt:69)
	at androidx.lifecycle.viewmodel.ViewModelProviderImpl.getViewModel$lifecycle_viewmodel_release$default(ViewModelProviderImpl.kt:47)
	at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.android.kt:91)
	at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:51)
	at androidx.lifecycle.ViewModelLazy.getValue(ViewModelLazy.kt:35)
	at io.livekit.android.composesample.CallActivity.getViewModel(CallActivity.kt:85)
	at io.livekit.android.composesample.CallActivity.access$getViewModel(CallActivity.kt:83)
	at io.livekit.android.composesample.CallActivity$onResume$1.invokeSuspend(CallActivity.kt:149)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at androidx.lifecycle.DispatchQueue.drainQueue(DispatchQueue.jvm.kt:74)
	at androidx.lifecycle.DispatchQueue.resume(DispatchQueue.jvm.kt:53)
	at androidx.lifecycle.LifecycleController.observer$lambda$0(LifecycleController.jvm.kt:40)
	at androidx.lifecycle.LifecycleController.$r8$lambda$INWMOb0xmlhb_ycZo7uXu7mUdSw(Unknown Source:0)
	at androidx.lifecycle.LifecycleController$$ExternalSyntheticLambda0.onStateChanged(Unknown Source:4)
	at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.jvm.kt:320)
	at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.jvm.kt:257)
	at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.jvm.kt:293)
	at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.jvm.kt:142)
	at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.jvm.kt:124)
	at androidx.lifecycle.ReportFragment$Companion.dispatch$lifecycle_runtime_release(ReportFragment.android.kt:190)
	at androidx.lifecycle.ReportFragment$LifecycleCallbacks.onActivityPostResumed(ReportFragment.android.kt:125)
	at android.app.Activity.dispatchActivityPostResumed(Activity.java:1536)
	at android.app.Activity.performResume(Activity.java:9167)
	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5399)
	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5508)
	at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
	at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:8919)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@feecb82, Dispatchers.Main.immediate]
---------------------------- PROCESS ENDED (7831) for package io.livekit.android.composesample ----------------------------

                                                                                                    	```

@tamimattafi
Copy link

I noticed that, if you start a call without e2ee, then hangup, then start one with e2ee, it doesn't crash. It crashes only if you start a call immediately with e2ee. Seems like something isn't loading correctly.

@davidliu
Copy link
Contributor

Ah, you'll probably need to call LiveKit.init(appContext) prior to using E2EE, depending on how your code is setup. Usually we handle this when creating the room, but some native classes might be referenced while you're setting up your options beforehand.

I'll fix up our samples and documentation to reflect this.

@tamimattafi
Copy link

@davidliu Adding LiveKit.init(this) to io.livekit.android.composesample.SampleApplication in onCreate fixed the crash. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants