I'm using Kotlin and JNI as I'm looking to port a C program to Android and I'm wondering why I'm currently getting an "art_sigsegv_fault" as soon as the JNI function's breakpoint is hit.
Kotlin code:
import com.root.Main
class SettingsScreenActivity : AppCompatActivity() {
private val MainC = Main()
fun startButton(view: View)
MainC.callMainFromJNI("test")
}
}
MainC.c
JNIEXPORT void JNICALL Java_com_root_hping2_Main_callMainFromJNI(JNIEnv *env, jobject pThis, jstring argument){
printf("Size of char: %ld byte\n",sizeof(char));
return;
}
Breakpoint is on the printf , however, when I go to debug, I get the "art_sigsegv_fault" error and I'm not able to see any of the values of the parameters. This is within Android Studio
EDIT: When i remove the jstring argument and don't pass the string into the function, it works correctly. What would the reason for this be?