1.错误描述
Error:Execution failed for task ':app:compileDebugNdk'.
> 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.
2.错误原因
项目有C++文件,但是没有添加NDK支持;
3.解决方案
在buildType{}添加:
sourceSets{
main {
jni.srcDirs = []
}
}