Android SDK Manager Install Specific Version of NDK Bundle
Asked Answered
G

5

18

I'm trying to install NDK 15c and I can't seem to figure out how to tell sdkmanager the version. If I run

sdkmanager "ndk-bundle"

I will get the latest which I don't want.

I've tried different combinations but nothing works:

sdkmanager "ndk-bundle;15c"

sdkmanager "ndk-bundle;15.2.4203891"

sdkmanager "ndk-bundle;15.2"
Grouch answered 25/9, 2018 at 17:43 Comment(0)
Y
14

You can just download the android-NDK from their archives and integrate it with your android studio. You can download android-NDK 15 from the given URL:

https://developer.android.com/ndk/downloads/older_releases

To connect it with android studio, extract it into your drive and in android studio, go to File -> Project Structure -> SDK Location -> NDK Path (Put extracted path here)

Yell answered 25/9, 2018 at 18:4 Comment(1)
Note that the path of the folder where the NDK gets extracted should not contain white spaces and should not reside in the program folder of Android Studio.Pronounced
A
15

If you're using Gradle plugin 3.5 or later (in beta at time of writing, but will be out soon), add the following to your build.gradle:

android {
    ndkVersion "19.2.5345600" // NDK r19c
}

If you're using an older Gradle plugin, you can download old NDK releases from https://developer.android.com/ndk/downloads/older_releases and point ndk.dir in your local.properties file at that instead.

Aeolotropic answered 25/9, 2018 at 20:31 Comment(3)
Looks like only r20 really supports the automatic downloading of the NDK package. Downloading of r19c does not work: No version of NDK matched the requested version 19.2.5345600. Versions available locally: 20.0.5594570Mirnamirror
That's a bug. Please file an Android Studio bug by following b.android.comAeolotropic
For anyone that reads this in the future, a bug was filed here: issuetracker.google.com/issues/132876707. However, I am seeing this still broken in r21, so I filed another bug here: issuetracker.google.com/issues/143630825Apennines
C
15

As stated in the docs:

  1. Use the sdkmanager tool to view versions of CMake and NDK packages that are available:

    sdkmanager --list
    
  2. Pass the sdkmanager the strings for the packages that you want to install. For example, to install CMake and the NDK, use the following syntax:

    sdkmanager --install
      "ndk;major.minor.build"
      "cmake;major.minor.micro.build"
    
Catalog answered 15/11, 2019 at 18:25 Comment(2)
This should be accepted answerCap
this answer saved my life :), since I have just access to command line in remote serverTout
Y
14

You can just download the android-NDK from their archives and integrate it with your android studio. You can download android-NDK 15 from the given URL:

https://developer.android.com/ndk/downloads/older_releases

To connect it with android studio, extract it into your drive and in android studio, go to File -> Project Structure -> SDK Location -> NDK Path (Put extracted path here)

Yell answered 25/9, 2018 at 18:4 Comment(1)
Note that the path of the folder where the NDK gets extracted should not contain white spaces and should not reside in the program folder of Android Studio.Pronounced
I
3

I have the same issue. I resolved it through the SDK manager under SDK Tools, click Show Package Details and then scroll under NDK (Side by side) and tick and apply the version you need. See the image below:

enter image description here

Ito answered 26/10, 2022 at 9:33 Comment(0)
P
0

You can download previous versions of NDK in Android Studio by clicking- Tools > SDK Manager. SDK Tools Select the Show Package Details checkbox. NDK (Side by side) checkbox

choose the version you want to download

This is clearly explained in the following Url-

https://developer.android.com/studio/projects/install-ndk#apply-specific-version

Polacre answered 22/10, 2021 at 10:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.