How to fix android studios 2.3 NDK bug?

Ryder Thacker 08/20/2017. 9 answers, 13.558 views
android android android-ndk android-ndk

I'm assuming it's a bug since I didn't have any problems until the new update. So I cant use the gradle console to debug my app because I have this warning -

"Configuration on demand is an incubating feature. NDK is missing a "platforms" directory. If you are using NDK, verify the ndk.dir is set to a valid NDK directory. It is currently set to C:\Users\Emily Thacker\AppData\Local\Android\Sdk\ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or to remove this warning."

I am pretty sure I am not using NDK and I dont see how I can fix this problem here is my

## This file is automatically generated by Android Studio.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
# This file should *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=C\:\\Users\\Emily Thacker\\AppData\\Local\\Android\\Sdk

Also I do not see a ANDROID_NDK_HOME file in my directory.

Harshit Agrawal 03/08/2017
which version of gradle are you using?
3 Ryder Thacker 03/08/2017
I'm using version 3.3.

9 Answers

xsveda 03/16/2017.

It is an Android Gradle plugin bug, already reported here:

3 Matt 06/20/2017
The bug report entry ( states that the warning will be fixed in gradle plugin version 2.4 and above.

Carl 04/24/2017.

I was able to prevent this annoying message; here is what worked for me.


  1. I am not using the NDK at all, and had never installed the NDK.

  2. However, as mentioned in another answer here by xsveda, this is a Gradle bug that is documented here:

    and so even the "NDK-innocent" may become its victims.

  3. The problem is that Gradle is computing the location of an NDK folder by just tacking on the string "/ndk-bundle" to the SDK folder location, even if you have never installed the NDK.

  4. After establishing this false expectation of an NDK folder existing in a particular location, each time you build, Gradle gives you a warning that you're "missing" that folder. This is just a warning and does not prevent your build from completing, but it is annoying.


Since disk space is cheap, and my time is precious to me, I humored this bug by installing the NDK, even though I do not intend to use it.

To do this, you can go to:

File -> Project Structure -> SDK Location

and look in the Android NDK location field. If you have not installed the NDK, this field will be empty.

In that case, below that field will be a link for installing the NDK. Click on that link and install it. It takes a few minutes.

Once the installation completes and you close the installation progress dialog, the location of the NDK will be automatically written into the Android NDK location field. This will be something like:


Click the OK button and build again. The error disappears.

Note that you may be able to just type the expected folder into this field; I did not try that. But I don't know whether that might cause some other problems, especially if you eventually decide to actually use the NDK.

Harshit Agrawal 03/09/2017.

You can give it a try :

There is a checkbox for it in android studio already.

Android Studio -> Preferences -> Compiler -> Gradle -> Command-line Options

enter image description here

2 Ryder Thacker 03/08/2017
Still not working.
Harshit Agrawal 03/09/2017
This probably happens because of Fast Build Process
3 Ryder Thacker 03/10/2017
Configure on demand was already checked for me.
Harshit Agrawal 03/10/2017
@RyderThacker uncheck it and than sync gradle again

gnB 05/23/2017.

Sounds like maybe updating SDK from Android Studio IDE could help

Steps are:

  1. Go to Tools (top-menu item) > Android > SDK Manager
  2. Click SDK Tools tab
  3. Scroll down to the NDK checkbox update-option

Screen shots here: How to update Android NDK in place?

CorayThan 06/26/2017
That doesn't fix the issue, that just downloads the NDK, which you probably don't have any good reason to download.

Alex Cohn 03/21/2017.

You should not use a directory path with spaces for Android SDK. As an easy cure you can manually change


You don't need to install NDK.

Oleksandr 07/26/2017.

Fixed this issue by removing an empty ndk-bundle folder from SDK root folder (have no idea why and when it has appeared):

ndk-bundle folder in android SDK folder

Here is the explanation why it helps from the issue on Android bug tracker:

For anyone still experience this issue on plugin 3.0.0-alpha1 or later. Please file a new bug and try to answer all question in #33. We need more information to debug the problem and adding comments to a closed bug is an easy way for it to get lost.

To give a bit of background, the plugin checks whether the NDK directory is valid. Most likely, you are not using NDK. We automatically assume it's in {sdk}/ndk-bundle. It will be ignored if {sdk}/ndk-bundle does not exist. If you see 'NDK is missing a "platforms" directory.', it means there is an {sdk}/ndk-bundle, but not a {sdk}/ndk-bundle/platforms directory. This means you have a corrupted NDK for some reason. It is safe to just remove {sdk}/ndk-bundle if you are not using it.

davenpcj 08/17/2017.

For me, the NDK error turned out to be a false diagnosis. This error occurred when gradle threw a ClassNotFound exception on class.

Although the class is defined in Java 8, it was not included in the JDK 1.8.0u51 (or presumably earlier versions) which I had installed.

Updating the JDK and removing the 1.8.0u51 version resolved the issue.

RagsB 06/21/2017.

Just install the Android NDK.

That fixed my error and warning!

  1. Go to Tools -> Android -> SDK Manager
  2. Click SDK Tools
  4. Apply and quit.
RagsB 06/21/2017
well, Here are the steps to install NDK, 1. GO to tools.2.Android 3.SDK Manager.3. SRK tools 4. CHECK NDK Click Apply and then OK! 5.Rebuild

Lalit Baghel 04/14/2017.

I am gives a solution which is work for me. This type of error statement are:-

1.NDK is missing a "platforms" directory.

2.How to set ANDROID_NDK_HOME so that Android Studio does not ask for ndk location?

Soultion: You are trying more solution While you are not require NDK

please open your build.gradle and here you are used two gradle path like:-

classpath '' classpath ''

here you can remove a class path and use only one

classpath of gradle and then clean the project This is working for me never requre to set the ndk path or the ndk setting.

Android Studio NDK 2.3 BUG

Patrick Robert Shea O'Connor 05/24/2017
This appears to be an issue where you tried to use two version of gradle, and you opted to keep 2.2.0, which "fixed" the bug. What your suggesting is to downgrade to 2.2.0, which isn't a solution to using 2.3 and working around this bug.
Lalit Baghel 06/02/2017
use any installed verion of gradle like classpath '' - Download Hi-Res Songs

1 (G)I-DLE


(G)I-DLE. 2018. Writer: Riot Music Team;Harloe.
2 Ariana Grande

​Thank U, Next flac

Ariana Grande. 2018. Writer: Crazy Mike;Scootie;Victoria Monét;Tayla Parx;TBHits;Ariana Grande.
3 Imagine Dragons

Bad Liar flac

Imagine Dragons. 2018. Writer: Jorgen Odegard;Daniel Platzman;Ben McKee;Wayne Sermon;Aja Volkman;Dan Reynolds.
4 Clean Bandit

Baby flac

Clean Bandit. 2018. Writer: Jack Patterson;Kamille;Jason Evigan;Matthew Knott;Marina;Luis Fonsi.
5 Backstreet Boys

Chances flac

Backstreet Boys. 2018.

Waste It On Me flac

BTS. 2018. Writer: Steve Aoki;Jeff Halavacs;Ryan Ogren;Michael Gazzo;Nate Cyphert;Sean Foreman;RM.
7 Fitz And The Tantrums

HandClap flac

Fitz And The Tantrums. 2017. Writer: Fitz And The Tantrums;Eric Frederic;Sam Hollander.
8 BlackPink

Kiss And Make Up flac

BlackPink. 2018. Writer: Soke;Kny Factory;Billboard;Chelcee Grimes;Teddy Park;Marc Vincent;Dua Lipa.
9 Lady Gaga

I'll Never Love Again flac

Lady Gaga. 2018. Writer: Benjamin Rice;Lady Gaga.
10 Diplo

Close To Me flac

Diplo. 2018. Writer: Ellie Goulding;Savan Kotecha;Peter Svensson;Ilya;Swae Lee;Diplo.
11 Halsey

Without Me flac

Halsey. 2018. Writer: Halsey;Delacey;Louis Bell;Amy Allen;Justin Timberlake;Timbaland;Scott Storch.
12 Imagine Dragons

Machine flac

Imagine Dragons. 2018. Writer: Wayne Sermon;Daniel Platzman;Dan Reynolds;Ben McKee;Alex Da Kid.
13 Little Mix

The Cure flac

Little Mix. 2018. Writer: Pete Kelleher;Camille Purcell;Tom Barnes;Ben Kohn.
14 Bradley Cooper

Always Remember Us This Way flac

Bradley Cooper. 2018. Writer: Lady Gaga;Dave Cobb.
15 Calum Scott

No Matter What flac

Calum Scott. 2018. Writer: Toby Gad;Calum Scott.
16 Frida Sundemo

Apologize flac

Frida Sundemo. 2018.
17 Little Mix

Woman Like Me flac

Little Mix. 2018. Writer: Nicki Minaj;Steve Mac;Ed Sheeran;Jess Glynne.
18 Kelly Clarkson

Never Enough flac

Kelly Clarkson. 2018. Writer: Benj Pasek;Justin Paul.
19 Ashley Tisdale

Voices In My Head flac

Ashley Tisdale. 2018. Writer: John Feldmann;Ashley Tisdale.
20 Haley Reinhart

Something Strange flac

Haley Reinhart. 2018.

Related questions

Hot questions


Popular Tags