天天看点

问题: Your project contains C++ files but it is not using a supported native build system.解决方法

使用JNI时出现问题:

Error: Your project contains C++ files but it is not using a supported native build system.

  Consider using CMake or ndk-build integration. For more information, go to:

   https://d.android.com/r/studio-ui/add-native-code.html

  Alternatively, you can use the experimental plugin:

   https://developer.android.com/r/tools/experimental-plugin.html
           

原因:

         1. 没有创建Android.mk文件进行库文件配置;

        2. 没有把Android.mk文件添加到项目中;

解决方法:

1.切换到Android视图

问题: Your project contains C++ files but it is not using a supported native build system.解决方法

2.选择项目或模块,右击,选择Link C++ Project with Gradle

问题: Your project contains C++ files but it is not using a supported native build system.解决方法

3.在Build System中选择ndk-build,并在Project Path添加Android.mk路径

问题: Your project contains C++ files but it is not using a supported native build system.解决方法

4.完成。