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. 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

Android studio3.0 开发jni时遇到的
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. 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
原因:在app的build.gradle中没用配置cmake

android {
    ...
    defaultConfig {
        ....

        externalNativeBuild {
            cmake {
                cppFlags "-std=c++11 -D__CORRECT_ISO_CPP_WCHAR_H_PROTO"
            }
//            ndk {
//                abiFilters "armeabi", "armeabi-v7a"
//            }
        }
    }
    buildTypes {
       ...
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
}
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,961评论 2赞 45
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 180,444评论 25赞 708
  • 昨晚做了很美的一个梦:我又回到故乡,在满天星光的河埠头,拉着女儿的手一起看天际的流星雨。梦醒后那一空璀璨的星星一直...
    晨光下的黄丝巾阅读 754评论 4赞 9
  • 后天有一个Trader的面试,绿书计划今天要看完,以及邮件里提到的Hull里的几章。 概率随机过程随机积分PDEO...
    Lebkuchen阅读 345评论 0赞 1
  • 她是个讨人喜爱的女孩当然不缺追求者但是她没有接受任何一个 她说自己害怕恋爱即使心动也不敢行动 她遇到一个帅大叔一见...
    文刀之元阅读 302评论 0赞 2

友情链接更多精彩内容