Android SDK Manager Install Specific Version of NDK Bundle

让人想犯罪 __ 提交于 2019-12-07 00:15:26

问题


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"

回答1:


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)




回答2:


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.




回答3:


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"
    


来源:https://stackoverflow.com/questions/52503989/android-sdk-manager-install-specific-version-of-ndk-bundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!