android studio3.0 NDK编译Error: cannot use ‘throw’ with exceptions disabled

  • 默认的情况下,Android Studio中是没有开启C++的标准异常,
    所以,会导致一下编译报错:
    cannot use ‘throw’ with exceptions disabled
    解决:在app-build.gradle中:android节点- defaultConfig - externalNativeBuild
externalNativeBuild {
            cmake {
                cppFlags "-fexceptions"
            }
        }


作者:栗子酱油饼
链接:https://www.jianshu.com/p/b2493007387f
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

你可能感兴趣的:(android studio3.0 NDK编译Error: cannot use ‘throw’ with exceptions disabled)