Skip to content

Assets fail to load from workspace packages after migrating from path-based dependencies #177765

@moneer-octedia

Description

@moneer-octedia
  • Description

After migrating from path-based package declarations to using Dart workspaces, assets defined within workspace packages no longer load in the Flutter app.

  • Steps to Reproduce

Create a workspace setup following the official Dart workspace documentation
Define a package within the workspace that contains assets
Declare the assets in the package's pubspec.yaml
Reference these assets from the main Flutter app
Run the app

  • Expected behavior:

Assets load correctly, as they did with path-based dependencies

  • Actual behavior:

Assets fail to load

  • Minimal Reproduction

I've created a minimal reproduction repository that demonstrates this issue:
https://github.com/moneer-octedia/workspace_assets

  • The repository shows:

Working setup with path-based dependencies
Broken setup after migrating to workspaces
Asset declarations in both the package and main app

  • Additional Context

This issue may belong to either the Dart pub team or Flutter team. Regardless of where the fix belongs, the workspace documentation should include guidance on handling assets in workspace packages, as this is a common use case when migrating existing projects.

flutter doctor -v [✓] Flutter (Channel stable, 3.35.6, on macOS 15.4.1 24E263 darwin-arm64, locale en-SA) [507ms] • Flutter version 3.35.6 on channel stable at /Users/moneeroctedia/fvm/versions/3.35.6 • Upstream repository https://github.com/flutter/flutter.git • Framework revision 9f455d2 (3 weeks ago), 2025-10-08 14:55:31 -0500 • Engine revision d291363 • Dart version 3.9.2 • DevTools version 2.48.0 • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [2.9s]
• Android SDK at /Users/moneeroctedia/Library/Android/sdk
• Emulator version 33.1.24.0 (build_id 11237101) (CL:N/A)
• Platform android-36, build-tools 35.0.0
• Java binary at: /Users/moneeroctedia/.sdkman/candidates/java/current/bin/java
This JDK is specified in your Flutter configuration.
To change the current JDK, run: flutter config --jdk-dir="path/to/jdk".
• Java version OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [1,093ms]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 16E140
• CocoaPods version 1.16.2

[✓] Chrome - develop for the web [26ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [26ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /Applications/Android Studio.app
• Java version OpenJDK Runtime Environment (build 21.0.6+-13355223-b631.42)

[✓] IntelliJ IDEA Community Edition (version 2023.2.2) [24ms]
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.105.0) [5ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.120.0

[✓] Connected device (3 available) [6.2s]
• Octedia’s iPhone (mobile) • 00008110-001E39080182401E • ios • iOS 18.7.1 22H31
• macOS (desktop) • macos • darwin-arm64 • macOS 15.4.1 24E263 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 141.0.7390.123
! Error: Browsing on the local area network for Moneer’s iPhone. 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 [705ms]
• All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: assetsPackaging, accessing, or using assetsa: imagesLoading, displaying, rendering imagesfound in release: 3.35Found to occur in 3.35found in release: 3.38Found to occur in 3.38has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-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