Reputation: 6616
My ndk is located at C:\Users\X\AppData\Local\Android\ndk
. Now each time I create a new native android project and try to import into Android Studio, it asks me for the location of ndk. I can manually set the ndk in local.properties
also.
But I am looking for a way to set this ndk path, so that Android Studio does not ask me to set this path each time.
I have already set ANDROID_NDK_HOME, as well as NDK_HOME in system environment variable on Windows 10 machine, but Android Studio is still not able to find it. I have restarted my machine as well, still no luck.
I have not tried it on mac, but your answers for both windows and mac are welcome.
Upvotes: 35
Views: 87331
Reputation: 13628
I didn't use ndk-bundles in my Project, but got this issue anyway.
I solved it like this:
Go to your sdk.dir (maybe have a look into local.properties
).
If you don't use ndk, you shouldn't see an /ndk-bundle directory. If it's appear in your /sdk-Directory, look into it (should be emtpy).
Remove this ndk-bundle folder
After that, my error-messages are gone.
Upvotes: 5
Reputation: 63
Execution failed for task ':app:stripDebugDebugSymbols'.
No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669
Open Android Studio -> Preferences -> Appearance & Behaviour -> System Settings -> Android SDK -> SDK Tools -> Show Package Details -> Select "NDK" -> select missing package -> Apply https://github.com/facebook/react-native/issues/28404
Upvotes: 1
Reputation: 400
now is deprecated. read documentation
add to build.gradle
android {
ndkVersion '21.0.6113669' //version
}
Upvotes: 5
Reputation: 330
Set ndk folder location in local.properties file
ndk.dir=C:/Users/{username}/AppData/Local/Android/Sdk/ndk/21.3.6528147
Happy Fluttering ....
Upvotes: 5
Reputation: 1354
File > Project Structure > SDK Location Download the ndk and then sync the project hope it will solve the problem
Upvotes: 3
Reputation: 8546
1.Check the NDK Path.
Select the menu File > Project Structure > SDK Location
, Android NDK Location
if it is not set yet, then click ...
, and browse to your NDK location and click "OK" (you may also choose "download").
2.To have it edit the local.properties file of your project
ndk.dir = YOUR_NDK_PATH
Set a Environment variable for your system
ANDROID_NDK_HOME = "YOUR_PATH_TO_LOCATE_NDK_BUNDLE"
default if you downloaded from SDK manager then it will be
"YOUR_SDK_PATH/android-sdk-windows\ndk-bundle"
Once you set once. If will by default use the settings for Ndk location for the all your android projects too.
Upvotes: 21