背景
- Android Studio 3.0
- 已配置ndk.dir
- jni函数无误
异常
> Error: Your project contains C++ files but it is not using a supported native build system.
Consider using CMake or ndk-build integration with the stable Android Gradle plugin:
https://developer.android.com/studio/projects/add-native-code.html
or use the experimental plugin:
https://developer.android.com/studio/build/experimental-plugin.html.
解决方法
It seems that you already have the C++ code, and the Makefiles in the project directory, in which case, you simply have to link Gradle to the native library:
In your project pane, right-click on your module, and select Link C++ Project with Gradle.
From the drop-down select either CMake or ndk-build, depending on your project
a. If you selected CMake, specify the CMakeLists.txt script in your project
b. If you selected ndk-build, specify the Android.mk.
https://stackoverflow.com/questions/41791429/error-your-project-contains-c-files-but-it-is-not-using-a-supported-native-bu/42364491#42364491?newreg=2d146beb65f04fe2bfeca1544f54d641