cannot resolve corresponding JNI function 记录一种解决方法

我用android studio 4.0 直接建立了一个C++程序

cannot resolve corresponding JNI function 解决方法
上面的图是解决后的,解决之前 stringFromJNI(); 方法是爆红的,并且提示:
Cannot resolve corresponding JNI function Java_com_xxx native_xxx
Reports native method declaration in Java where no corresponding JNI function is found in the project.

网络上一般的解决方案:

File—>Setting—>plugins

将 Android NDK Support 的对勾勾掉

用这个方案,没有解决。我自己查看plugins里面的内容
cannot resolve corresponding JNI function 解决方法
发现不知道什么时候装的一个插件不支持c/c++,怀疑是这个导致的禁用之后解决问题。

cannot resolve corresponding JNI function 解决方法
这个依然启用这,现在可以跳转到c++ 代码中。

相关文章: