Cannot resolve corresponding JNI function Java_com_xxxx

转载自:https://blog.csdn.net/ksksjipeng/article/details/51992435

 

配置好NDK环境后,编写native方法,编译出现

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--->Settings--->Plugins,将Android NDK Support后面的对勾去掉,如下图

重启Android Studio即可

The error "Cannot resolve symbol 'JAVA_HOME'" typically occurs when the system is unable to find the Java Development Kit (JDK) installation directory. To resolve this issue, you can try the following steps: 1. Verify that Java is installed on your system by running the command `java -version` in your command prompt or terminal. If Java is not installed, you need to download and install the JDK from the official Oracle website. 2. Set the `JAVA_HOME` environment variable to the JDK installation directory. This variable is used by various tools and applications to locate the Java installation. The steps to set the `JAVA_HOME` variable depend on your operating system: - For Windows: - Go to the System Properties (right-click on My Computer or This PC, select Properties). - Click on the "Advanced system settings" link. - Click on the "Environment Variables" button. - In the "System Variables" section, click on the "New" button. - Enter `JAVA_HOME` as the variable name and the path to your JDK installation directory as the variable value (e.g., `C:\Program Files\Java\jdk1.8.0_271`). - Click "OK" to save the changes. - For Linux/macOS: - Open a terminal window. - Edit the `.bashrc` or `.bash_profile` file in your home directory using a text editor (e.g., `nano ~/.bashrc` or `nano ~/.bash_profile`). - Add the following line at the end of the file: ``` export JAVA_HOME=/path/to/your/jdk ``` - Save the file and exit. - Run the command `source ~/.bashrc` or `source ~/.bash_profile` to apply the changes. 3. After setting up the `JAVA_HOME` variable, restart your command prompt or terminal to ensure the changes take effect. 4. Verify that the `JAVA_HOME` variable is set correctly by running the command `echo %JAVA_HOME%` (Windows) or `echo $JAVA_HOME` (Linux/macOS). It should display the path to your JDK installation directory. By following these steps, you should be able to resolve the "Cannot resolve symbol 'JAVA_HOME'" error.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值