How to completely disable NDK support in Android Studio

android ndk
android studio ndk path
location specified by ndk.dir did not contain a valid ndk and and couldn't be used
uninstall android ndk
how to find ndk path in android studio
remove ndk from project
install android ndk command line

We have a multi-platform project, with native support, that we are developing in Android Studio using libgdx. We have builds working for Desktop, IOS, Android, Android Wear, and HTML5.

On each of these platforms, we have a different "native" plugin that we are using: a static .a native library on IOS, a .dll on Windows, a bunch of .so files in Android, and a Javascript library on HTML5. All of these, except for the HTML5 version, are built on separate platforms so can't possibly be built by the same Android Studio NDK build.

The problem is that for each of the .java files that declare JNI routines, Android Studio 1.4.x wants to find the source files, but those source files can't possibly be compiled in the IOS project, and likewise for the PC project when running on a Mac.

The standard solution on SO is to add

sourceSets {
    main {
        jni.srcDirs = [] //disable automatic ndk-build

To the android{} section, but this ONLY works for the Android, Android Wear launcher projects, and NOT Desktop, IOS, HTML5, etc.

I just want Android Studio to give up on trying to compile NDK, because it can't possibly be done on non-Android projects. Other than finding a downgrade somewhere, how do I do that?


How to disable NDK for a certain project in Android Studio, android ndk location specified by ndk.dir did not contain a valid ndk and and couldn't be used no toolchains found in the ndk toolchains folder for abi with prefix:  With a project open, click Tools > SDK Manager. Click the SDK Tools tab. Select the NDK (Side by side) and CMake checkboxes. Figure 1: The SDK Tools window showing the NDK (Side by side) option. Note: If you have an NDK installed in the ndk-bundle folder, it appears in the list with the label NDK.

Correct way is to uninstall NDK using SDK manager. go to Android Studio-> Tools -> SDK Manager

Under SDK tools tab uncheck "NDK", "CMake", "LLDB" and then apply changes. NDK components will be removed. Downside is NDK is removed for all project. Still struggling to find a way to disable NDK for a particular project only.

How to completely disable NDK support in Android Studio, Android Studio also supports ndk-build due to the large number of you should open your file and remove the following line of  We’ve just released another update to Android Studio 1.3's canary channel, Release Candidate 1. This build contains a big new feature: Android NDK support, with support for editing, running and debugging C and C++ code! Note however that NDK support is only preview quality, and will remain in preview status for the upcoming final 1.3 release

If you would like to keep the NDK build for future use and not use it for specific projects just make sure to uncheck these options in the new project dialog...

Install and configure the NDK and CMake, Remove any previously generated binaries. Note: On Mac OS X, running ndk-​build clean with a high number of parallel executions may result in  Getting Started with the NDK The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.

Getting Started with the NDK | Android NDK, Learn about Gradle in Android Studio. When you build your app, Gradle runs CMake or ndk-build, and packages shared libraries with your APK. To manually configure Gradle to link to your native library, you need to add the Application Binary Interfaces (ABIs) the NDK supports and packages them all into your APK. LLVM's libc++ is the C++ standard library that has been used by the Android OS since Lollipop, and as of NDK r18 is the only STL available in the NDK. Note: See the C++14 Status , C++17 Status , and C++2a Status pages for full details of the expected level of C++ library support for any given version.

ndk-build | Android NDK, Android Studio 2.2 and higher support building C/C++ components of your Android project with Remove the deprecated ndkCompile If you manually configured your project to build its native code by calling ndk-build, follow this guide to  Android NDK is a companion tool of Android SDK that allows you to build performance-critical parts of your app using native code (with the help of such languages as C and C++). It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming

Link Gradle to your native library, Using both CMake and ndk-build in the same module is not currently supported. If you want to import an existing ndk-build library into your Android Studio  On my video, I completely removed all the files of Android Studio and removed the Android Studio. I have more videos on how to download & install Android Studio and Java windows 10 with the latest