Repository navigation
[Android] Build fails on Flutter 3.38.5: "Android NDK Clang could not be found" #180163
Copy link
Copy link
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toola: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appc: crashStack traces logged to the consoleStack traces logged to the consolec: fatal crashCrashes that terminate the processCrashes that terminate the processfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamplatform-androidAndroid applications specificallyAndroid applications specificallyt: flutter doctorProblem related to the "flutter doctor" toolProblem related to the "flutter doctor" toolteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
Steps to reproduce
Build the project with flutter build apk --release
Expected results
The APK generation.
Actual results
The command flutter build apk --release fails with: Android NDK Clang could not be found..
The problem does not occur if I remove the cupertino_http dependency 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
name: prova_deps
description: "A new Flutter project."
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
environment:
sdk: ^3.9.2
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.8
http: ^1.6.0
provider: ^6.1.5
auto_scroll_text: ^0.0.7
cupertino_http: ^2.4.0
dio: ^5.9.0
cookie_jar: ^4.0.8
dio_cookie_manager: ^3.3.0
shared_preferences: ^2.5.4
simple_dns_client:
path: "/media/matteo/Dati/dart projects/simple_dns_client"
package_info_plus: ^9.0.0
synchronized: ^3.4.0
reorderables: ^0.6.0
audio_service: ^0.18.18
taudio: ^10.3.8
fluttertoast: ^9.0.0
crypto: ^3.0.6
sqflite: ^2.4.2
path_provider: ^2.1.5
mutex: ^3.1.0
flutter_image_cache: ^1.0.2
objectbox_flutter_libs: ^5.1.0
objectbox: ^5.1.0
dev_dependencies:
flutter_test:
sdk: flutter
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^6.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.38.5, on Debian GNU/Linux 13 (trixie)
6.12.57+deb13-amd64, locale it_IT.UTF-8) [399ms]
• Flutter version 3.38.5 on channel stable at /home/matteo/sdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f6ff1529fd (9 giorni fa), 2025-12-11 11:50:07 -0500
• Engine revision 1527ae0ec5
• Dart version 3.10.4
• 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.0.0)
[10,0s]
• Android SDK at /home/matteo/sdk/android
• Emulator version 36.3.10.0 (build_id 14472402) (CL:N/A)
• Platform android-36, build-tools 36.0.0
• Java binary at: /snap/android-studio/209/jbr/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.7+-13880790-b1038.58)
• All Android licenses accepted.
[✓] Chrome - develop for the web [59ms]
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop [1.480ms]
• Debian clang version 19.1.7 (3+b1)
• cmake version 3.31.6
• ninja version 1.12.1
• pkg-config version 1.8.1
• OpenGL core renderer: Mesa Intel(R) UHD Graphics (CML GT2) (X11)
• OpenGL core version: 4.6 (Core Profile) Mesa 25.0.7-2 (X11)
• OpenGL core shading language version: 4.60 (X11)
• OpenGL ES renderer: Mesa Intel(R) UHD Graphics (CML GT2) (X11)
• OpenGL ES version: OpenGL ES 3.2 Mesa 25.0.7-2 (X11)
• OpenGL ES shading language version: OpenGL ES GLSL ES 3.20 (X11)
• GL_EXT_framebuffer_blit: yes (X11)
• GL_EXT_texture_format_BGRA8888: yes (X11)
[✓] Connected device (2 available) [619ms]
• Linux (desktop) • linux • linux-x64 • Debian GNU/Linux 13 (trixie)
6.12.57+deb13-amd64
• Chrome (web) • chrome • web-javascript • Google Chrome 143.0.7499.169
[✓] Network resources [1.765ms]
• All expected network resources are available.
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: buildBuilding flutter applications with the toolBuilding flutter applications with the toola: releaseChallenges faced when attempting to productionize an appChallenges faced when attempting to productionize an appc: crashStack traces logged to the consoleStack traces logged to the consolec: fatal crashCrashes that terminate the processCrashes that terminate the processfyi-toolFor the attention of Flutter Tool teamFor the attention of Flutter Tool teamplatform-androidAndroid applications specificallyAndroid applications specificallyt: flutter doctorProblem related to the "flutter doctor" toolProblem related to the "flutter doctor" toolteam-androidOwned by Android platform teamOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
tirth-patel-nc commentedon 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.
brianquinlan commentedon Dec 22, 2025
From @dcharkes (dart-lang/http#1867 (comment)):
11 remaining items
MatteoBax commentedon Jan 9, 2026
I’m not experiencing this issue with the
cupertino_httppackage on Flutter 3.35.7dklenowski commentedon Jan 15, 2026
This was happening to me on Flutter 3.38.6/Windows. Fixed it by unsetting the environment variable
ANDROID_NDK_HOME.. not sure why.ValeriusGC commentedon Jan 15, 2026
In my case
sentry_flutterwas a foe ))sentry_flutter: 9.8.0 works well
but
sentry_flutter: ^9.9.2 - crash my build
flutter 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!EvertJanDeBruin commentedon Jan 16, 2026
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.
dcharkes commentedon Jan 16, 2026
@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.)
adlyyy4 commentedon Jan 19, 2026
I was having the same issue my solution was
Install the Android NDK through Android Studio:
alexlapa commentedon Jan 19, 2026
Switching to main fixed this issue for me.
reidbaker commentedon Jan 26, 2026
@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
moodless3 commentedon Jan 28, 2026
switch to beta channel . then apply upgrade , it will avoid this issue for sure . other work arounds wont
jake-johnson-disney commentedon Feb 2, 2026
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:
The 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.
westito commentedon Feb 10, 2026
The only one working solution I found was adding
"android-ndk": "{{Your android SDK dir}}/sdk/ndk/28.2.13676358",to~/.config/flutter/settingsfilexlk777 commentedon Mar 5, 2026
export ANDROID_NDK_HOME=your ndk home
Mind-Reaper-Shuk commentedon Mar 23, 2026
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/[hooks] Don't require NDK for Android targets (#180594)