My flutter app could build fine before, but after updating Android Studio and Flutter today I get the following error when trying to build: "No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669". How can this error be solved?
The NDK version 20.0.5594570 can be install manually by going into
android studio
-> SDK manager
-> SDK tools
.
Select the show package detail checkbox.
You will be able to see all the NDK versions available.
More details: https://developer.android.com/studio/projects/install-ndk
If this issue occurred after updating android studio to 3.6 or updating the gradle plugin or gradle wrapper, then you can simply select your locally installed NDK in the Project Structure Dialog
You can open the Project Structure Dialog by clicking File > Project Structure...
or by pressing the hotkeys CTRL + ALT + SHIFT + S
Once the Project Structure Dialog is open, go to SDK Location and select your locally installed version of NDK under Android NDK Location. Typically this is installed somewhere in your user folder then \AppData\Local\Android\Sdk\ndk\%ndk version%
at least for Windows.
Project Structure dialog screenshot
It's usually recommended to install the latest version fo NDK available and use that for your projects.
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