gpt4 book ai didi

android - 使用 Twilio JavaI420Buffer (Kotlin) 时出现 UnsatisfiedLinkError

转载 作者:行者123 更新时间:2023-12-05 00:02:59 40 4
gpt4 key购买 nike

描述
尝试通过以下调用分配 JavaI420Buffer 时:

tvi.webrtc.JavaI420Buffer.allocate(width, height)
我收到以下错误:
java.lang.UnsatisfiedLinkError: No implementation found for java.nio.ByteBuffer tvi.webrtc.JniCommon.nativeAllocateByteBuffer(int) (tried Java_tvi_webrtc_JniCommon_nativeAllocateByteBuffer and Java_tvi_webrtc_JniCommon_nativeAllocateByteBuffer__I)
at tvi.webrtc.JniCommon.nativeAllocateByteBuffer(Native Method)
at tvi.webrtc.JavaI420Buffer.allocate(JavaI420Buffer.java:87)
at dji.ux.beta.core.widget.fpv.FPVWidget$onSurfaceTextureAvailable$yuvDataListener$1.onYuvDataReceived(FPVWidget.kt:417)
在此错误之前,我还得到:
2021-05-28 08:31:27.367 15131-15131/? I/tvi.webrtc.Logging: NativeLibrary: Loading native library: jingle_peerconnection_so
2021-05-28 08:31:27.367 15131-15131/? I/tvi.webrtc.Logging: NativeLibrary: Loading library: jingle_peerconnection_so
2021-05-28 08:31:27.369 15131-15131/? E/tvi.webrtc.Logging: NativeLibrary: Failed to load native library: jingle_peerconnection_so
2021-05-28 08:31:27.369 15131-15131/? E/tvi.webrtc.Logging: NativeLibrary: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjingle_peerconnection_so.so" not found
2021-05-28 08:31:27.370 15131-15131/? E/tvi.webrtc.Logging: NativeLibrary: java.lang.UnsatisfiedLinkError: dlopen failed: library "libjingle_peerconnection_so.so" not found
奇怪的是,如果我声明使用官方 org.webrtc 库( implementation 'org.webrtc:google-webrtc:1.0.32006' ),那么本地调用分配字节缓冲区就会成功。
视频 Android SDK 版本 com.twilio:video-android-ktx:6.3.0

最佳答案

First of all when you load native code in kotlin it should be like this:

companion object {
init {
System.loadLibrary("jingle_peerconnection")
}
}

In Java

static {
System.loadLibrary("jingle_peerconnection")
}

Second as per your error, "library "libjingle_peerconnection_so.so" not found => you have to add related Android architectures folder in "main -> java -> libs" folder

Example : main -> java -> libs -> x86 -> .so file

关于android - 使用 Twilio JavaI420Buffer (Kotlin) 时出现 UnsatisfiedLinkError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67770944/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com