'How to return and cast jobjectArray from JNI method to Java in Android Studio?
I work with the Android NDK and want to cats a jobjectArray to String[] In Java.
Codes make this error:
JNI DETECTED ERROR IN APPLICATION: use of invalid jobject 0x70fbe0d670
Java Class:
private static native String[] GetData();
JNI:
#include <jni.h>
extern "C"
JNIEXPORT jobjectArray JNICALL
Java_com_x_GetData(JNIEnv *env, jclass clazz)
{
return (jobjectArray)(new const char* []{ "abc", "def"});
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
