Skip to content

flutter build bundle --profile fails in newly created project #164149

@vially

Description

@vially

Steps to reproduce

  1. Create new project: flutter create --platforms=linux foobar
  2. Try to build the bundle for profile or release modes: flutter build bundle --profile

Expected results

The flutter build bundle --profile or flutter build bundle --release should succeed.

Actual results

flutter build bundle --profile/flutter build bundle --release fails with:

$ flutter build bundle --release

Target release_flutter_bundle failed: PathNotFoundException: Cannot copy file to
'build/flutter_assets/NativeAssetsManifest.json', path =
'/tmp/foobar/.dart_tool/flutter_build/baf6bb6fd15b6359e32f98799ec47fc9/native_assets.json
' (OS Error: No such file or directory, errno = 2)
[...]
Failed to build bundle.

Code sample

This happens in a newly created project with: flutter create --platforms=linux foobar

Screenshots or Video

Screenshots / Video demonstration
flutter-build-bundle-error.mp4

Logs

Logs
$ flutter build bundle --release

Target release_flutter_bundle failed: PathNotFoundException: Cannot copy file to
'build/flutter_assets/NativeAssetsManifest.json', path =
'/tmp/foobar/.dart_tool/flutter_build/baf6bb6fd15b6359e32f98799ec47fc9/native_assets.json
' (OS Error: No such file or directory, errno = 2)
#0      _checkForErrorResponse (dart:io/common.dart:58:9)
#1      _File.copy.<anonymous closure> (dart:io/file_impl.dart:409:7)
#2      _rootRunUnary (dart:async/zone.dart:1538:47)
#3      _CustomZone.runUnary (dart:async/zone.dart:1429:19)
<asynchronous suspension>
#4      ForwardingFile.copy (package:file/src/forwarding/forwarding_file.dart:29:51)
<asynchronous suspension>
#5      ForwardingFile.copy (package:file/src/forwarding/forwarding_file.dart:29:51)
<asynchronous suspension>
#6      copyAssets.<anonymous closure> (package:flutter_tools/src/build_system/targets/assets.dart:190:13)
<asynchronous suspension>
#7      Future.wait.<anonymous closure> (dart:async/future.dart:528:21)
<asynchronous suspension>
#8      copyAssets (package:flutter_tools/src/build_system/targets/assets.dart:132:3)
<asynchronous suspension>
#9      CopyFlutterBundle.build (package:flutter_tools/src/build_system/targets/common.dart:84:34)
<asynchronous suspension>
#10     _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:876:9)
<asynchronous suspension>
#11     FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:637:16)
<asynchronous suspension>
#12     BundleBuilder.build (package:flutter_tools/src/bundle_builder.dart:86:32)
<asynchronous suspension>
#13     BuildBundleCommand.runCommand (package:flutter_tools/src/commands/build_bundle.dart:158:5)
<asynchronous suspension>
#14     FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1558:27)
<asynchronous suspension>
#15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#16     CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#17     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:496:9)
<asynchronous suspension>
#18     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#19     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:431:5)
<asynchronous suspension>
#20     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:98:11)
<asynchronous suspension>
#21     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:154:19)
<asynchronous suspension>
#22     main (package:flutter_tools/executable.dart:99:3)
<asynchronous suspension>

Failed to build bundle.

Flutter Doctor output

Doctor output
$ flutter doctor --verbose
[✓] Flutter (Channel stable, 3.29.0, on Arch Linux 6.13.4-arch1-1, locale en_US.UTF-8)
    [33ms]
    • Flutter version 3.29.0 on channel stable at /home/vially/.local/share/flutter-sdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 35c388afb5 (2 weeks ago), 2025-02-10 12:48:41 -0800
    • Engine revision f73bfc4522
    • Dart version 3.7.0
    • DevTools version 2.42.2

[✓] Linux toolchain - develop for Linux desktop [184ms]
    • clang version 19.1.7
    • cmake version 3.31.6
    • ninja version 1.12.1
    • pkg-config version 2.3.0

[!] Flutter IDE Support (No supported IDEs installed) [13ms]
    • IntelliJ - https://www.jetbrains.com/idea/
    • Android Studio - https://developer.android.com/studio/
    • VS Code - https://code.visualstudio.com/

[✓] Connected device (2 available) [65ms]
    • Linux (desktop)        • linux         • linux-x64 • Arch Linux 6.13.4-arch1-1
    • Linux Wayland (mobile) • linux-wayland • linux-x64 • flust (dev)

[✓] Network resources [609ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: assetsPackaging, accessing, or using assetsc: regressionIt was better in the past than it is nowfound in release: 3.29Found to occur in 3.29found in release: 3.30Found to occur in 3.30has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions