Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: build ndk version mismatch after upgrade

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?

like image 988
ClWin Avatar asked Feb 25 '20 10:02

ClWin


2 Answers

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

like image 144
mingliang94 Avatar answered Sep 23 '22 18:09

mingliang94


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.

like image 42
Subaru Tashiro Avatar answered Sep 24 '22 18:09

Subaru Tashiro