问题: 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视图

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

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


————————————————
版权声明:本文为CSDN博主「柚子君.」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/gengkui9897/article/details/86350598

你可能感兴趣的:(Android中级)