1

I recently downloaded Android Studio 3.5.1. Have also downloaded all the SDK tools enter code here

Error I am getting

enter image description here

this is the android sdk folder content

enter image description here

How do I resolve this?

WISHY
  • 11,067
  • 25
  • 105
  • 197

3 Answers3

2

Remove the ndk.dir line from your build.gradle. That's the older method of specifying the NDK to use, and that path is wrong for the NDK you've installed.

AGP 3.5 allows you to install multiple NDKs simultaneously (if you check the "show package details" box you'll see that "NDK (Side by side)" expands) and select which one to use in your build.gradle with android.ndkVersion.

You can continue using ndk.dir for now, but it's deprecated and there isn't much reason to.

See https://developer.android.com/studio/projects/install-ndk for more information.

Dan Albert
  • 10,079
  • 2
  • 36
  • 79
1

Try like this. /your/path/Android/sdk/ndk/20.0.5594570

But in case you are creating a native application using Android Studio, I think you should not locate for your ndk path manual.

1

The issue was the path only. Apparently android studio downloaded ndk as Library/Android/sdk/ndk/20.0.5594570/allfiles I had to rename the ndk folder to ndk-bundle and moved the subfolder files to ndk folder.

WISHY
  • 11,067
  • 25
  • 105
  • 197
  • AS 3.5 uses [NDK side-by-side](https://stackoverflow.com/a/56348606/192373) and does not need **ndk-bundle** anymore, if you remove the **ndk** line from **local.properties**. You can choose the NDK version for gradle build (e.g. `android.ndkVersion '19.2.5345600'`), or the latest will be picked. – Alex Cohn Oct 11 '19 at 14:48
  • "I had to rename the ndk folder to ndk-bundle and moved the subfolder files to ndk folder." Remove ndk.dir from your local.properties instead. How did that end up there in the first place? – Dan Albert Oct 11 '19 at 18:58