小编kot*_*ser的帖子

伴随对象 Kotlin JNI 中的 UnsatisfiedLinkError

我正在我的一个移动应用程序中将代码从 Java 转换为 Kotlin,而在 Java 中运行的代码在 Kotlin 中停止运行。它使用 JNI 桥来调用 C++ 代码。

Kotlin 方法声明:

class Converter{  
    companion object {
        external fun convertNative(width: Int, height: Int, row: Int, input: ByteArray, ft: Int, output: ByteArray)
    }
}
Run Code Online (Sandbox Code Playgroud)

.cc 代码:

   extern "C" {
    JNIEXPORT void JNICALL OBJECT_TRACKER_METHOD(convertNative)(JNIEnv* env, jobject thiz, jint width, jint height, jint row,
    jbyteArray input, jint ft, jbyteArray output);
}
    JNIEXPORT void JNICALL OBJECT_TRACKER_METHOD(convertNative)(
    JNIEnv* env, jobject thiz, jint width, jint height, jint row,
    jbyteArray input, jint ft, jbyteArray output) …
Run Code Online (Sandbox Code Playgroud)

java java-native-interface android kotlin

1
推荐指数
1
解决办法
717
查看次数

标签 统计

android ×1

java ×1

java-native-interface ×1

kotlin ×1