Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using an asset from a package cause splash screen generation to fail #687

Open
iapicca opened this issue Apr 9, 2024 · 2 comments
Open

Comments

@iapicca
Copy link

iapicca commented Apr 9, 2024

Describe the bug

using an asset from a package (see docs), cause splash screen generation to fail

Configuration

dependencies:
# ...
  yakforward_brand:
    git:
      url: https://github.com/yakforward-ou/brand.git
# ...

flutter:
  uses-material-design: true
  assets:
    - packages/yakforward_brand/logo.png

flutter_native_splash:
  color: '#FFFFFF'
  image: packages/yakforward_brand/logo.png
  android: false
  ios: false
  web: true

To Reproduce

  • create a package with an asset (image) in the lib folder (or use the package above)
  • import the assets as in the configuration above
  • copy the configuration above and run dart run flutter_native_splash:create

logs

dart run flutter_native_splash:create
Building package executable... (1.7s)
Built flutter_native_splash:create.
The file "packages/yakforward_brand/logo.png" set as the parameter "image" was not found.

note that the asset is available in app using

 Image.asset('packages/yakforward_brand/logo.png');

Additional context

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.19.5, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
  ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.3.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at
    /Users/francesco/fvm/versions/stable. Consider adding /Users/francesco/fvm/versions/stable/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.88.0)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 1 category.

cc @jonbhanson

@jonbhanson
Copy link
Owner

Your project does not have a packages/yakforward_brand folder, so the command does not find any images. Try putting your images in your project's assets folder instead.

@iapicca
Copy link
Author

iapicca commented Apr 14, 2024

Your project does not have a packages/yakforward_brand folder, so the command does not find any images. Try putting your images in your project's assets folder instead.

@jonbhanson
the point is to use an image from a package (see docs),
if I have to manually download it into the asset folder it defeat the purpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants