Skip to content

PathNotFoundException: Cannot open file, path = 'assets/icon/icon.png' (OS Error: No such file or directory, errno = 2) #628

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

Open
umairshah3sb opened this issue Jan 26, 2025 · 4 comments
Labels

Comments

@umairshah3sb
Copy link

ℹ️ Info

💬 Description

📜 Pubspec.yaml

flutter_launcher_icons:
  android: 
  ios: 
  image_path: 
@mmohammadmfallahm02
Copy link

Hey @umairshah3sb , I had the same issue, and it was solved by following the discussion in #588 . You might want to check it out—it could help you as well!

@chotixity
Copy link

What is suggested in #588 is a workaround. isn't there a way that it can pick the directory given instead of having to edit the file manually

@densaldanha
Copy link

Looking at your pubspec.yaml file seems like you havent mentioned a path to your icon.png file

Also make sure to mention it under assets. Make sure to also update the flutter_laucher_icons.yaml file that is generated at the root of your project.

@pmagnuson
Copy link

Having a very similar issue:

pubspec.yaml (mostly generated) changed the image_path throughout

# flutter pub run flutter_launcher_icons
flutter_launcher_icons:
  # image_path: "assets/icon/icon.png"
  image_path: "assets/icons/BuddhaTime1024.png"

  android: "launcher_icon"
  # image_path_android: "assets/icon/icon.png"
  min_sdk_android: 21 # android min sdk min:16, default 21
  # adaptive_icon_background: "assets/icon/background.png"
  # adaptive_icon_foreground: "assets/icon/foreground.png"
  # adaptive_icon_monochrome: "assets/icon/monochrome.png"

  ios: true
  # image_path_ios: "assets/icon/icon.png"
  remove_alpha_channel_ios: true
  # image_path_ios_dark_transparent: "assets/icon/icon_dark.png"
  # image_path_ios_tinted_grayscale: "assets/icon/icon_tinted.png"
  # desaturate_tinted_to_grayscale_ios: true

  web:
    generate: true
    image_path: "assets/icons/BuddhaTime1024.png"
    background_color: "#hexcode"
    theme_color: "#hexcode"

  windows:
    generate: true
    image_path: "assets/icons/BuddhaTime1024.png"
    icon_size: 48 # min:48, max:256, default: 48

  macos:
    generate: true
    image_path: "assets/icons/BuddhaTime1024.png"

dart run flutter_launcher_icons

Building package executable... 
Built flutter_launcher_icons:flutter_launcher_icons.
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.14.3)                               
  ════════════════════════════════════════════
  
• Creating default icons Android

✕ Could not generate launcher icons
PathNotFoundException: Cannot open file, path = 'assets/icon/icon.png' (OS Error: No such file or directory, errno = 2)

why is this looking for 'assets/icon/icon.png'?

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

No branches or pull requests

5 participants