Arkham007
Arkham007

Reputation: 161

✓ Successfully generated launcher icons , Unhandled exception: FileSystemException: Cannot open file, path = 'dev_assets/news-logos.jpeg'

I am getting this error when I am trying to change the app icon with the "flutter_launcher_icons 0.9.2". I tried specifing the app minsdk and targetsdk but that did not work.I have done flutter pub get several times. After that when I do:flutter pub run flutter_launcher_icons:main. I get this error

This is my pubspec.yaml:

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_launcher_icons: ^0.9.2

flutter_icons:
  android: true
  ios: true
  image_path: "dev_assets/news-logos.jpeg"
  adaptive_icon_background: "#FFFFFF"
  adaptive_icon_foreground: "dev_assets/news-logos.jpeg"

my android/app/build.gradle:

defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.news_app"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

Full error:

✓ Successfully generated launcher icons
Unhandled exception:
FileSystemException: Cannot open file, path = 'dev_assets/news-logos.jpeg' (OS Error: The system cannot find the path specified.
, errno = 3)
#0      _File.throwIfError (dart:io/file_impl.dart:635:7)
#1      _File.openSync (dart:io/file_impl.dart:479:5)
#2      _File.readAsBytesSync (dart:io/file_impl.dart:539:18)
#3      decodeImageFile (package:flutter_launcher_icons/utils.dart:35:44)
#4      createDefaultIcons (package:flutter_launcher_icons/android.dart:35:24)
#5      createIconsFromConfig (package:flutter_launcher_icons/main.dart:103:28)
#6      createIconsFromArguments (package:flutter_launcher_icons/main.dart:60:7)
#7      main (file:///D:/flutter_windows_2.5.1-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.2/bin/main.dart:6:26)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
pub finished with exit code 255

Folders

Upvotes: 2

Views: 3434

Answers (4)

Ali Murat
Ali Murat

Reputation: 161

The source of the problem is the inability to provide Assets support for the iOS side of the project. For that open XCode.

Runner > General > App Icons and Launcher Images

You will see the red error in the directory. Create your Assets structure by changing here:

flutter pub get

flutter pub run flutter_launcher_icons:main

Upvotes: 0

Harsh Sureja
Harsh Sureja

Reputation: 1394

Currently flutter_launcher_icon only support PNG image formate, so may that issue in you app. Try to add PNG image.

Upvotes: 1

Frank nike
Frank nike

Reputation: 388

This seems like a windows error. I have few solutions

  1. Right click on news-logos.jpeg and copy relative path then paste in anywhere that needs it.

  2. Change dev_assets/news-logos.jpeg to dev_assets\news-logos.jpeg as windows doesn't use /

Upvotes: 1

Evgen
Evgen

Reputation: 87

Read the error, your path to the file is not correct.

Upvotes: -3

Related Questions