您的位置:首页 > 编程语言 > C语言/C++

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

2017-11-02 10:08 507 查看
Android Studio升级到3.0后,运行Android Studio项目出现这个问题:

Error:Execution failed for task ':app:compile001001_chinasowebDebugNdk'.
> 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[/code] 
有的说在gradle.properties中添加:

android.useDeprecatedNdk=true


但是也会报错。

正确的修改方式是在build.gradle(Module:app)的buildType上面添加下面一段:

sourceSets {
main {
jni.srcDirs = []
}
}
buildTypes {
、、、
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android
相关文章推荐