Repository navigation
[Android] Build fails on Flutter 3.38.5: "Android NDK Clang could not be found" #180163
Description
Activity
- addedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Dec 22, 2025 @MatteoBax thanks for the report. Since it is specific to that package I recommend filing it https://github.com/dart-lang/http/issues. We can take a look if you're redirected here.
Also that package is specific to iOS/macOS.
- addedr: invalidIssue is closed as not validIssue is closed as not validand removedin triagePresently being triaged by the triage teamPresently being triaged by the triage team
on Dec 22, 2025 From @dcharkes (dart-lang/http#1867 (comment)):
Thanks for the report @MatteoBax!
Yes, this an error from Flutter tools.
I see flutter doctor is not in line with what's need for build hooks, we also need an Android NDK as part the Android SDK.
Please file an issue on the Flutter repo with a proposed solution.
Two parts of a solution:
Make flutter doctor complain about the NDK missing.
Don't error on a missing NDK, but pass null to the CCompilerConfig that is passed to the build hook.
(We did a similar change to address #178715, though there we do always require a clang for running on Linux desktop because you need clang anyway to compile your app.)- addedc: crashStack traces logged to the consoleStack traces logged to the consoleplatform-androidAndroid applications specificallyAndroid applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.a: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appteam-androidOwned by Android platform teamOwned by Android platform teamfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamc: fatal crashCrashes that terminate the processCrashes that terminate the processand removedr: invalidIssue is closed as not validIssue is closed as not valid
on Dec 23, 2025 11 remaining items
- is there a previous version of 3.38 that does not have this issue?
I’m not experiencing this issue with the
cupertino_httppackage on Flutter 3.35.7This was happening to me on Flutter 3.38.6/Windows. Fixed it by unsetting the environment variable
ANDROID_NDK_HOME.. not sure why.In my case
sentry_flutterwas a foe ))
sentry_flutter: 9.8.0 works well
but
sentry_flutter: ^9.9.2 - crash my buildflutter doctor -v [✓] Flutter (Channel stable, 3.38.7, on macOS 15.7.1 24G231 darwin-arm64, locale en-GB) [1,104ms] • Flutter version 3.38.7 on channel stable at /usr/local/Caskroom/flutter/1.22.6/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 3b62efc2a3 (2 days ago), 2026-01-13 13:47:42 -0800 • Engine revision 78fc3012e4 • Dart version 3.10.7 • DevTools version 2.51.1 • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging [✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [11.3s] • Android SDK at /Users/vvk/Library/Android/sdk • Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A) • Platform android-36, build-tools 36.1.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java This is the JDK bundled with the latest Android Studio installation on this machine. To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`. • Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 16.3) [2.7s] • Xcode at /Applications/Xcode.app/Contents/Developer • Build 16E140 • CocoaPods version 1.16.2 [✓] Chrome - develop for the web [9ms] • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Connected device (2 available) [6.0s] • macOS (desktop) • macos • darwin-arm64 • macOS 15.7.1 24G231 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 143.0.7499.193 ! Error: Browsing on the local area network for iPhone (Frostyland). Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources [20.9s] • All expected network resources are available. • No issues found!Reacted by Haris RubanovićI got the same issue, but do not have
cupertino_http,sentry_flutterorANDROID_NDK_HOME.Any recommended fixes?
I have downgraded to "resolve" this.Update: i was integrating melos for my packages at the same time, apparently (somehow) this was the cause. Downgrading to an older flutter release dit not solve my problem, removing melos did.
@EvertJanDeBruin I've landed a fix on main #180594, does switching to the main channel resolve your issue? (It might also already be in the latest beta.)
I was having the same issue my solution was
Install the Android NDK through Android Studio:- Open Android Studio
- Go to Tools → SDK Manager
- Click the SDK Tools tab
- Check NDK (Side by side)
Switching to main fixed this issue for me.
@dcharkes is there something we can cherry pick into the 3.41 beta (the next stable)Confirmed the linked pr is in 3.41 which is a beta but will be the next stable. ETA sometime in feb 2026
git branch -r --contains a0a2783 | grep flutter- origin/flutter-3.41-candidate.0Reacted by Daco Harkesswitch to beta channel . then apply upgrade , it will avoid this issue for sure . other work arounds wont
in our case we hit this issue in our GitHub Actions workflow on ubuntu-latest. The root cause was our disk cleanup step was deleting the pre-installed NDK:
# This breaks Flutter 3.38.x builds: sudo rm -rf /usr/local/lib/android/sdk/ndk || trueThe NDK is pre-installed on GitHub's ubuntu-latest runners, and Flutter 3.38.x needs it for native asset compilation. While Flutter can auto-install the NDK via sdkmanager, removing the entire /ndk directory before the build causes this failure.
Fix options:
Don't delete the NDK directory in cleanup steps
If you must free disk space, only delete specific old NDK versions you don't need
Explicitly reinstall the required NDK after cleanup:echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "ndk;YOUR_VERSION"This may help others seeing this error only in CI but not locally.
The only one working solution I found was adding
"android-ndk": "{{Your android SDK dir}}/sdk/ndk/28.2.13676358",to~/.config/flutter/settingsfileexport ANDROID_NDK_HOME=your ndk home
Reacted by XDY.Reacted by XDY.I solved by deleting all folders of ndk higher than the one you intend to use.
e.g I wanted to use 29.0.14206865 , so I deleted existing folders of ndk 30
Path to see all ndk
/Android/sdk/ndk/Reacted by Estraven and João Pedro Freire- added a commit that references this issue
on Sep 28, 2026
Steps to reproduce
Build the project with
flutter build apk --releaseExpected results
The APK generation.
Actual results
The command
flutter build apk --releasefails with:Android NDK Clang could not be found..The problem does not occur if I remove the
cupertino_httpdependency or use Flutter version 3.35.7.Code sample
Since the code for this issue is irrelevant, I'm attaching the pubspec.yaml.
pubspec.yaml
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
output.log
Flutter Doctor output
Doctor output