Flutter fails with "No suitable NDK found for target architecture" error in old project but runs fine in new project
When I try to run an old project (for Android) after the flutter update the app fails to build with error Bad state: No suitable NDK found for target architecture arm64. But will run fine with a new project even with the old project's pubspec.yaml.
I have already tried all the answers mentioned in <https://stackoverflow.com/questions/60392680/flutter-build-ndk-version-mismatch-after-upgrade> and <https://stackoverflow.com/questions/61157024/compatible-side-by-side-ndk-version-was-not-found-default-is-20-0-5594570/61510602#61510602> and most of the things remotely related to NDK issue. Also reinstalled the Flutter, Android studio and cleared the cache. Also replaced the old project android folder with the new porject's android folder, but still no luck.
Flutter version - 3.47.1
Android Studio Quail 3 | 2026.1.3 Patch 1
Here's the detailed error
Unhandled exception:
Bad state: No suitable NDK found for target architecture arm64.
#0 main.<anonymous closure> (file:///Users/username/.pub-cache/hosted/pub.dev/android_libcpp_shared-0.1.0/hook/build.dart:31:7)
<asynchronous suspension>
#1 build (package:hooks/src/api/build_and_link.dart:191:5)
<asynchronous suspension>
#2 main (file:///Users/username/.pub-cache/hosted/pub.dev/android_libcpp_shared-0.1.0/hook/build.dart:12:3)
<asynchronous suspension>
Building assets for package:android_libcpp_shared failed.
build.dart returned with exit code: 255.
To reproduce run:
(cd /Users/username/.pub-cache/hosted/pub.dev/android_libcpp_shared-0.1.0/; /Volumes/external/apps/flutter/bin/cache/dart-sdk/bin/dart --packages=/Volumes/external/own_apps/resume/resume_app/.dart_tool/package_config.json /Volumes/external/own_apps/resume/resume_app/.dart_tool/hooks_runner/android_libcpp_shared/10aa41e27a/hook.dill --config=/Volumes/external/own_apps/resume/resume_app/.dart_tool/hooks_runner/android_libcpp_shared/10aa41e27a/input.json )
stderr:
Unhandled exception:
Bad state: No suitable NDK found for target architecture arm64.
#0 main.<anonymous closure> (file:///Users/username/.pub-cache/hosted/pub.dev/android_libcpp_shared-0.1.0/hook/build.dart:31:7)
<asynchronous suspension>
#1 build (package:hooks/src/api/build_and_link.dart:191:5)
<asynchronous suspension>
#2 main (file:///Users/username/.pub-cache/hosted/pub.dev/android_libcpp_shared-0.1.0/hook/build.dart:12:3)
<asynchronous suspension>
stdout:
INFO: Searching for android NDK...
2
Target build_hooks failed: Error: Building native assets failed. See the logs for more details.
2
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Volumes/external/apps/flutter/bin/flutter'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 5s
Error: Gradle task assembleDebug failed with exit code 1
App failed to start
Flutter doctor -v
[✓] Flutter (Channel stable, 3.47.1, on macOS 26.0.1 25A362 darwin-arm64, locale en-IN) [790ms]
• Flutter version 3.47.1 on channel stable at /Volumes/external/apps/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 6655482ec0 (8 days ago), 2026-08-19 10:07:23 -0700
• Engine revision 5d53178869
• Dart version 3.13.1
• DevTools version 2.60.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop,
enable-android, enable-ios, cli-animations, enable-native-assets, enable-record-use,
enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [3.0s]
• Android SDK at /Volumes/external/android/sdk
• Emulator version 37.1.11.0 (build_id 15917651) (CL:N/A)
• Platform android-36, build-tools 36.0.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 25.0.2+-15348964-b329.117)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [2.2s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17A400
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [5ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (3 available) [6.2s]
• sdk gphone16k arm64 (mobile) • emulator-5554 • android-arm64 • Android 17 (API 37) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 26.0.1 25A362 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 144.0.7559.110
[✓] Network resources [806ms]
• All expected network resources are available.
• No issues found!
Does anyone encounted an issue like this or have any suggestion?
Can you share your both of your build.gradle file? The solution is more likely linked to your ndkVersion in your build.gradle (android/app). You should set the ndkVersion to based on what you need, personally I like to target the version 29, but it depends on your project needs. Here's my personal ndkVersion:
"29.0.14206865"