Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one disable C/C++ support for a project in Android Studio?

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.

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?

like image 579
John Perry Avatar asked Sep 10 '17 00:09

John Perry


People also ask

Does Android Studio support C language?

The Android Native Development Kit (NDK): a toolset that allows you to use C and C++ code with Android, and provides platform libraries that allow you to manage native activities and access physical device components, such as sensors and touch input.

Can C be compiled in Android platform?

Android is based on Linux Kernel so it's definitely possible to compile & run C/C++ programs on Android. C is quite cross-platform , so a C Program written in Windows can Run on Linux ( and android ) and vice versa.

How do I get to project settings on Android?

Project structure settings To change various settings for your Android Studio project, open the Project Structure dialog by clicking File > Project Structure.


1 Answers

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.

A more intensive cleanup would be to additionally delete the CMakeLists.txt and any C/C++ code from the project.

like image 100
ahasbini Avatar answered Oct 30 '22 02:10

ahasbini