Repository navigation
Native Assets Custom Device #187980
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listcustomer: toyotahas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool teamworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Description
Steps to reproduce
- Configure a Linux
custom-devicesentry (platform: linux-x64) andflutter config --enable-custom-devices --enable-native-assets. - Use a project whose dependency tree includes any package with a
hook/build.dartthat is normally only relevant on another platform — e.g.dev/integration_tests/new_galleryreproduces this directly. flutter run -d <custom-device-id>(orflutter build bundle).
Expected results
The asset bundle builds. Code-asset hooks that emit nothing for OS.linux (like objective_c) should not block the build, and no native (CMake) compiler match is required because a custom device / bundle build has no native app build.
Actual results
Target dart_build failed: Error: Could not read compiler configurations for build hooks, expected
build/flutter_assets/linux/x64/debug/CMakeCache.txt to exist.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:34:3)
#1 cCompilerConfigLinux (package:flutter_tools/src/isolated/native_assets/linux/native_assets.dart:30:5)
#2 LinuxAssetTarget.setCCompilerConfig (package:flutter_tools/src/isolated/native_assets/targets.dart:283)
#3 FlutterNativeAssetsBuildRunnerImpl.setCCompilerConfig (.../native_assets.dart:279)
#4 runFlutterSpecificHooks (.../native_assets.dart:101)
#5 DartBuild.build (.../build_system/targets/native_assets.dart:56)
...
Error: Failed to build bundle.
Flutter Doctor output
Doctor output
[!] Flutter (Channel [user-branch], 3.44.2, on Fedora Linux 43 (Workstation Edition) 7.0.10-100.fc43.x86_64, locale en_US.UTF-8) [22ms]
! Flutter version 3.44.2 on channel [user-branch] at /home/joel/workspace-automation/flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
! Upstream repository unknown source is not the same as FLUTTER_GIT_URL
• FLUTTER_GIT_URL = https:/github.com/flutter/flutter.git
• Framework revision c9a6c48423 (3 days ago), 2026-06-10 15:52:41 -0700
• Engine revision 77e2e94772
• Dart version 3.12.2
• DevTools version 2.57.0
• Feature flags: no-enable-web, enable-linux-desktop, no-enable-macos-desktop, no-enable-windows-desktop, no-enable-android,
no-enable-ios, enable-custom-devices, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file,
enable-lldb-debugging, enable-uiscene-migration, enable-riscv64
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update
checks and upgrades.
[✓] Linux toolchain - develop for Linux desktop [192ms]
• clang version 18.1.8
• cmake version 3.31.7
• ninja version 1.12.1
• pkg-config version 2.3.0
• OpenGL core renderer: AMD Ryzen 9 9950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 7.0.10-100.fc43.x86_64)
• OpenGL core version: 4.6 (Core Profile) Mesa 25.3.6
• OpenGL core shading language version: 4.60
• OpenGL ES renderer: AMD Ryzen 9 9950X 16-Core Processor (radeonsi, raphael_mendocino, LLVM 21.1.8, DRM 3.64, 7.0.10-100.fc43.x86_64)
• OpenGL ES version: OpenGL ES 3.2 Mesa 25.3.6
• OpenGL ES shading language version: OpenGL ES GLSL ES 3.20
• GL_EXT_framebuffer_blit: yes
• GL_EXT_texture_format_BGRA8888: yes
[✓] Connected device (2 available) [30ms]
• Linux (desktop) • linux • linux-x64 • Fedora Linux 43 (Workstation Edition) 7.0.10-100.fc43.x86_64
• Toyota homescreen (mobile) • desktop-homescreen • linux-x64 • homescreen x86_64
[✓] Network resources [177ms]
• All expected network resources are available.
! Doctor found issues in 1 category.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 listcustomer: toyotahas reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specificallyteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool teamworkaround availableThere is a workaround available to overcome the issueThere is a workaround available to overcome the issue
Activity
jwinarske commentedon Jun 13, 2026
Workaround
flutter config --no-enable-native-assets --enable-dart-data-assets(drops code assets from the build), or seed aCMakeCache.txtat the expected path pointing at a clang toolchain.Potential fix
thread a
mustMatchAppBuildflag (already supported by the asset targets for the widget-test path) from the bundle entry point so these builds skip the app-compiler match.jwinarske commentedon Jun 13, 2026
This resolves it, perhaps there is a better way?
0001-flutter_tools-Don-t-require-a-native-app-compiler-ma.patch
Patch...
mbcorona commentedon Jun 15, 2026
Hi @jwinarske , thanks for the detailed report, routing to the Linux team for further investigation.
loic-sharma commentedon Jun 15, 2026
cc @dcharkes as this seems to be a native assets issue. In case it's helpful, here are the docs on
custom-devices.I was able to reproduce a similar error on a Linux machine:
Turn on custom devices:
Add a custom device (follow the recommended values):
Navigate to the
new_galleryapp:Run
flutter build bundle:Logs: flutter build bundle
Logs: flutter build bundle --target-platform linux-x64
jwinarske commentedon Jun 20, 2026
Any update on this?
[flutter_tools] Fix native assets crash on Linux custom devices (flut…
Markus43 commentedon Jul 3, 2026
@bkonyi Are you planning a backport for the fix, as it is breaking bundle builds on stable?
bkonyi commentedon Jul 8, 2026
I've created a cherry pick for this PR, so it should go out in the next hotfix release after it's approved!
[stable] [flutter_tools] Fix native assets crash on Linux custom devi…
github-actions commentedon Jul 22, 2026
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
flutter doctor -vand a minimal reproduction of the issue.