-
Notifications
You must be signed in to change notification settings - Fork 27.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NDK issue after flutter upgrade, No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669 #53657
Comments
@r4v3r23 Related to #27967, gradle/gradle#12440 |
[✓] Flutter (Channel master, v1.16.4-pre.22, on Linux, locale en_US.UTF-8) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Android Studio (version 3.6) [!] Connected device ! Doctor found issues in 1 category. |
https://stackoverflow.com/a/60413117 and gradle/gradle#12440 (comment) @r4v3r23 What's the output of |
flutter doctor -vv
[ +11 ms] java -version [+2403 ms] [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) |
@jmagman I set NDK location in project structure but still get same result |
That output didn't have what I was hoping for, filed #53680. |
I was seeing this behaviour on latest stable
|
so whats the move here? |
The NDK doctor output was unrelated and unused, so you can ignore that. Flutter doesn't configure the app:stripDebugDebugSymbols Gradle task. Based on gradle/gradle#12440 (comment) it looks like a Gradle bug. Did any of the workarounds in that comment help? |
deleting NDK folder worked. I am still only able to build --debug versions of the app |
Can you file a new issue for that? Let's keep this one to see if other people are hitting the NDK bug. This is the only report I'm aware of. |
Deleting the NDK folder worked for me too. I had also previously accepted the ndk upgrade suggestion in Android Studio, something I don't usually do since I don't open Android Studio often |
same issue after upgrading graddle :( |
Only need go to tools-sdkmanager-sdktools-uncheck hide obsolete packages-check show package details-select ndk version and apply ____ done. |
I solved it by bringing the version of the grandle to 3.5.0 In android/build.grandle
Hope i help you guys!
|
Using gradle 3.5.0 worked for me too. It had been set to 3.6.3 which did not work. |
worked to me when i changed to this version thanks bro :) 👍 |
You need to install the exact version(20.0.5594570) requested in error from Android Studio-> Preferences -> Android SDK -> SDK Tools -> NDK(Side by side) No version of NDK matched the requested version 20.0.5594570. Versions available locally: 20.1.5948944, 21.2.6472646 |
@duladissa, no, you don't have to. No need to downgrade. Just put the NDK you wish to use into your
Still, it's a pain to change every time NDK upgrades. Flutter team, it's time to do something about it. :-) |
I fixed the error, opening the android folder on Android Studio, rebuild -> Download new NDK version. |
I was facing the same issue & was able to fix it by downloading the NDK & manually downgrading my project's Gradle version in the android/build.gradle from 4.0.1 to 3.5.0.
|
As mentioned above, there is no need to downgrade. Just specifiy the correct NDK to use. |
Downgrade to Android Gradle plugin 3.5.0 works because it is the last version when the default NDK version is not specified. |
I really can't understand why you would want to downgrade and potentially lose functionality (or bugfixes or whatever) when it's really as simple as a single line in your build file. But OK, each to their own. :-) |
The same issue is happening with me too. I can't downgrade android gradle to 3.5.0 due to an important dependency. |
@predatorx7 Just specify the current NDK version in |
This is a real pain in the neck when using CI / CD. Any suggestions besides downgrading gradle or manually setting the ndkVersion? |
Thanks all for your patience. I hadn't realized the amount of GitHub reactions there were in the response posts of the thread. I did a bit of digging and here's what I think is going on. I might not be 100% right but I think I'm close. Fundamentally this is a "bug" (or at least an ergonomic bug) in the Android Gradle Plugin that all Android projects use and theoretically should affect all Android projects that use native libraries. Flutter doesn't directly use the NDK but if any NDK is installed, it then uses an NDK to map debug symbols for stripped native libraries when debugging. The usability regression happened between AGP versions 3.6.0-beta02 (and thus includes release versions of 3.6.0) all the way through to 4.1.0. In those versions, as @shorben07 mentioned above, each specific AGP version prefers a specific associated NDK version. That's fine but it's a hassle if that specific NDK version isn't installed locally and AGP doesn't install it for you. AGP 4.1.0 fixes that bug in https://issuetracker.google.com/issues/144111441. Up until Flutter 2.0.0, the default template's AGP version was 3.5.0 so most Flutter users weren't running into this issue. You're likely running into this issue if you opened the /android folder in Android Studio before April 2020 (when AGP 4.0.0 was released), and clicked Or if you did the manual equivalent by editing the /android/build.gradle file and changing the version in: dependencies {
classpath 'com.android.tools.build:gradle:[a version >=3.6.0]'
} If you auto-updated AGP after April 2020 and before Flutter 2.0.0, you would have run into #58247 anyway since Flutter didn't support AGP version 4+ until Flutter 2.0.0. For all new projects created after Flutter 2.0.0, this issue doesn't occur either since new projects use AGP 4.1.0 since #71446. If you develop using add-to-app, you could also run into this issue if your host project that brings in a Flutter module uses an AGP version between 3.6 and 4.0 inclusively. If you're having issues currently, you can: 1- Go to your SDK manager, SDK Tools tab (click Show Package Details if you want to see which versions you have) and generally just remove the entire NDK category. AGP shouldn't make any attempts to desymbolicate native libraries if there aren't any NDKs installed 2- [Recommended] Go to your /android/build.gradle and change your AGP version to dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
} which is the latest stable release of AGP with https://issuetracker.google.com/issues/144111441 fixed. Then you shouldn't be manually bothered to install specific NDK versions anymore. 3- If you need to stay with your current AGP version for some reason, then manually install the requested NDK version in the SDK manager. For instance, if the error says 4- [Not recommended] You can pin a specific requested NDK version as suggested above #53657 (comment). It's ok if you just develop with Flutter (but if that's the case, you have no other restrictions and might as well use approach 1 or 2) but if you really use the NDK, each AGP version is specifically tested for compatibility with one NDK version, and you're losing that testing if you "mismatch" the version. Plus you get all the disadvantages of 3. |
|
Perfect! After spending 4 hours. Coding should be much simpler like this. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
I upgraded flutter master channel yesterday and now I receiving this message when installing:
flutter run
how do I fix this?
admin edit:
Please read the official answer in #53657 (comment)
The text was updated successfully, but these errors were encountered: