Android NDK C++ JNI (no implementation found for native…)

后端 未结 11 1195
慢半拍i
慢半拍i 2020-11-30 02:02

I\'m trying to use the NDK with C++ and can\'t seem to get the method naming convention correct. my native method is as follows:

extern \"C\" {
JNIEXPORT voi         


        
11条回答
  •  一个人的身影
    2020-11-30 02:32

    If your package name includes _ character, you should write 1(one) after _ character as shown below:

    MainActivity.java

    package com.example.testcpp_2;
    

    native-lib.cpp

    JNICALL
    Java_com_example_testcpp_12_MainActivity_stringFromJNI(
    

提交回复
热议问题