fluttercommunity / flutter_launcher_icons

Flutter Launcher Icons - A package which simplifies the task of updating your Flutter app's launcher icon. Fully flexible, allowing you to choose what platform you wish to update the launcher icon for and if you want, the option to keep your old launcher icon in case you want to revert back sometime in the future. Maintainer: @MarkOSullivan94
https://pub.dev/packages/flutter_launcher_icons
MIT License
1.96k stars 388 forks source link

[BUG] NoConfigFoundException #482

Open sara010 opened 1 year ago

sara010 commented 1 year ago

Unhandled exception:

✗ ERROR: NoConfigFoundException No configuration found in flutter_launcher_icons.yaml or in pubspec.yaml. In case file exists in different directory use --file option

0 createIconsFromArguments (package:flutter_launcher_icons/main.dart:82:7)

1 main (file:///Users/kevinhhliu/.pub-cache/hosted/pub.flutter-io.cn/flutter_launcher_icons-0.11.0/bin/flutter_launcher_icons.dart:7:26)

2 main (file:///Users/kevinhhliu/.pub-cache/hosted/pub.flutter-io.cn/flutter_launcher_icons-0.11.0/bin/main.dart:7:26)

3 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:32)

4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

use the 0.11.0 version i found that use flutter_icons: xxx works!

this is because i view the source code 'flutter_launcher_icons_config.dart': /// Loads flutter launcher icons config from pubspec.yaml file static FlutterLauncherIconsConfig? loadConfigFromPubSpec(String prefix) { try { final pubspecFile = File(path.join(prefix, constants.pubspecFilePath)); if (!pubspecFile.existsSync()) { return null; } final pubspecContent = pubspecFile.readAsStringSync(); return yaml.checkedYamlDecode<FlutterLauncherIconsConfig?>( pubspecContent, (json) { // todo: add support for new scheme https://github.com/fluttercommunity/flutter_launcher_icons/issues/373 return json == null || json['flutter_icons'] == null ? null : FlutterLauncherIconsConfig.fromJson(json['flutter_icons']); }, allowNull: true, ); } on yaml.ParsedYamlException catch (e) { throw InvalidConfigException(e.formattedMessage); } catch (e) { rethrow; } } }

eraloop commented 1 year ago

I have the same issue, is it like an update issue because i used this package just last week with another flutter application and it wasnt thriwing this error

vivialearn commented 1 year ago

I also had this error. Please update the docs.

Emadeddin-eibo commented 1 year ago

The lib Documentation is wrong, instead of:

flutter_launcher_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/icon.png"
  min_sdk_android: 21

You should use:

flutter_icons: <-- Just change this line.
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/icon.png"
  min_sdk_android: 21 
RatakondalaArun commented 1 year ago

Please upgrade to the latest version of the package. We introduced this change in recent release d314ca8

kauemurakami commented 1 year ago

try https://pub.dev/packages/icons_launcher

ProductOfAmerica commented 6 months ago

This is still not fixed... @RatakondalaArun

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0
  flutter_launcher_icons: "^0.13.1"

flutter_icons: #I've tried both `flutter_icons:` and `flutter_launcher_icons:` as the config name...
  android: "launcher_icon"
  ios: true
  image_path: "assets/images/app_logo.png"
  min_sdk_android: 21
Building package executable... (2.2s)
Built flutter_launcher_icons:flutter_launcher_icons.
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.13.1)
  ════════════════════════════════════════════

Unhandled exception:

✗ ERROR: NoConfigFoundException
No configuration found in flutter_launcher_icons.yaml or in pubspec.yaml. In case file exists in different directory use --file option
#0      createIconsFromArguments (package:flutter_launcher_icons/main.dart:84:7)