I want to install NDK to be able to use C/C++ native libraries. Upon trying to install the NDK, i get an error saying I do not have enough disk space in my C: Drive (because the download location is to the Temp Folder).
I've tried changing the temp path in the system variables but the ndk still downloads to C:\Users\User\Appdata\Local\Temp\PackageOperation02.
I then went to the project structure to change the Android NDK Location, but upon trying to choose ANY folder to be my NDK location, I get an error saying "NDK does not contain any platforms".
Help for either that or why the download location is to the Temp folder would be appreciated.
I had the same issue and solve it : Go to SDK location find NDK folder and check the folders if one of them is empty or corrupted delete it and let the android studio use the latest version you have. That was the working one.
Android Studio installs all versions of the NDK in the android-sdk /ndk/ directory. Each version is located in a subdirectory with the version number as its name.
You'll need to point to your NDK in your eclipse by adding the path of ndk-build to Window > preferences > android > NDK. Right click on your project folder. Choose android tools -> add native support (the bottom one) and click finish. Now it will ask for a name for your .
For people seeing this in 2021:
The Android NDK's platform
directory has been obsolete since r19. The NDK team removed it altogether in r21 in January 2021. Although it is obsolete, it can still cause the above error in the Project Structure window. The stable version of the Android Studio IDE (at least on Mac) is still looking for the platform
directory when you select an r21 or higher version and try to Apply it. The IDE gives the error "NDK does not contain any platforms."
Until Android Studio is updated to stop looking for platform
, you can edit the local.properties
file yourself, like so:
ndk.dir=/Users/[username]/Library/Android/sdk/ndk/22.0.7026061 sdk.dir=/Users/[username]/Library/Android/sdk
This is what the Project Structure window would normally do for you behind the scenes.
directory of ndk is now within the sdk folder which is named as ndk and ndk-bundel but the assigning of ndk is now change we need to add ndk version in Android Gradle Plugin (AGP) like this
android { ndkVersion "version" // e.g., ndkVersion '21.3.6528147' }
you need also install CMake from SDK tools from sdk manager and need to set is also from the Gradle like below
android { ... externalNativeBuild { cmake { ... version "cmake-version" } }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With