如何在Android Studio中禁用对项目的C/C ++支持? [英] How does one disable C/C++ support for a project in Android Studio?
问题描述
我时不时地犯一个错误,尝试在Android Studio项目中启用C/C ++支持.我想我可能想使用C/C ++,但是我忘记了,至少在我的系统上,即使下载了NDK库之后,我也从未能够使它工作.
Every now and again, I make the mistake of trying to enable C/C++ support in an Android Studio project. I think that I might like to use C/C++, but I forget that, at least on my system, I've never once been able to get it to work, even after downloading the NDK library.
我一直在寻找如何从项目中删除对C/C ++的支持,但是您似乎只能找到关于如何启用/禁用NDK支持的问题(和答案),而不是如何删除对C/C ++的支持.项目的支持.
I've looked around for how to remove C/C++ support from a project, but it seems the only things you can find are questions (and answers) on how to enable/disable NDK support, rather than how to remove the support from a project.
那么,一个人怎么做到的?
So, how does one do that?
推荐答案
删除build.gradle
应用程序文件中的externalNativeBuild
块应该可以解决问题.还要在您的Java代码中查找任何System.loadLibrary("native-lib");
调用,并删除其相对的static
块.
Removing the externalNativeBuild
blocks within the build.gradle
app file should do the trick. Also look for any System.loadLibrary("native-lib");
calls within your java code and remove their relative static
block.
更深入的清理工作是从项目中另外删除CMakeLists.txt
和所有C/C ++代码.
A more intensive cleanup would be to additionally delete the CMakeLists.txt
and any C/C++ code from the project.
这篇关于如何在Android Studio中禁用对项目的C/C ++支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!