Я пытаюсь запустить этот пример на устройстве Android с сервером ktor, но у меня есть эта ошибка.
Я видел, что между Android и * 1003 существует какая-то несовместимость * класс, который используется в одной из библиотек ktor, но я не знаю, как его заменить.
Process: me.amryousef.webrtc_demo, PID: 19499
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Base64;
at io.ktor.util.Base64JvmKt.encodeBase64(Base64Jvm.kt:15)
at io.ktor.client.features.websocket.WebSocketContent.<init>(WebSocketContent.kt:17)
at io.ktor.client.features.websocket.WebSockets$Feature$install$1.invokeSuspend(WebSockets.kt:37)
at io.ktor.client.features.websocket.WebSockets$Feature$install$1.invoke(WebSockets.kt)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:278)
at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:63)
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:137)
at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:157)
at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:23)
at io.ktor.client.HttpClient.execute(HttpClient.kt:152)
at io.ktor.client.call.HttpClientCallKt.call(HttpClientCall.kt:80)
at io.ktor.client.call.UtilsKt.call(utils.kt:16)
at io.ktor.client.features.websocket.BuildersKt.webSocketRawSession(builders.kt:105)
at io.ktor.client.features.websocket.BuildersKt.webSocketSession(builders.kt:25)
at io.ktor.client.features.websocket.BuildersKt.webSocket(builders.kt:59)
at io.ktor.client.features.websocket.BuildersKt.ws(builders.kt:92)
at io.ktor.client.features.websocket.BuildersKt.ws$default(builders.kt:91)
at me.amryousef.webrtc_demo.SignallingClient$connect$1.invokeSuspend(SignallingClient.kt:56)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.util.Base64" on path: DexPathList[[zip file "/data/app/me.amryousef.webrtc_demo-1/base.apk"],nativeLibraryDirectories=[/data/app/me.amryousef.webrtc_demo-1/lib/x86, /data/app/me.amryousef.webrtc_demo-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at io.ktor.util.Base64JvmKt.encodeBase64(Base64Jvm.kt:15)
at io.ktor.client.features.websocket.WebSocketContent.<init>(WebSocketContent.kt:17)
at io.ktor.client.features.websocket.WebSockets$Feature$install$1.invokeSuspend(WebSockets.kt:37)
at io.ktor.client.features.websocket.WebSockets$Feature$install$1.invoke(WebSockets.kt)
at io.ktor.util.pipeline.SuspendFunctionGun.loop(PipelineContext.kt:278)
at io.ktor.util.pipeline.SuspendFunctionGun.access$loop(PipelineContext.kt:63)
at io.ktor.util.pipeline.SuspendFunctionGun.proceed(PipelineContext.kt:137)
at io.ktor.util.pipeline.SuspendFunctionGun.execute(PipelineContext.kt:157)
at io.ktor.util.pipeline.Pipeline.execute(Pipeline.kt:23)
at io.ktor.client.HttpClient.execute(HttpClient.kt:152)
at io.ktor.client.call.HttpClientCallKt.call(HttpClientCall.kt:80)
at io.ktor.client.call.UtilsKt.call(utils.kt:16)
at io.ktor.client.features.websocket.BuildersKt.webSocketRawSession(builders.kt:105)
at io.ktor.client.features.websocket.BuildersKt.webSocketSession(builders.kt:25)
at io.ktor.client.features.websocket.BuildersKt.webSocket(builders.kt:59)
at io.ktor.client.features.websocket.BuildersKt.ws(builders.kt:92)
at io.ktor.client.features.websocket.BuildersKt.ws$default(builders.kt:91)
at me.amryousef.webrtc_demo.SignallingClient$connect$1.invokeSuspend(SignallingClient.kt:56)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:238)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:594)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:742)
Suppressed: java.lang.ClassNotFoundException: java.util.Base64
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 24 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available`