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

[minor BUG] Success message even on failure. #225

Closed
happy-san opened this issue Jan 9, 2021 · 6 comments
Closed

[minor BUG] Success message even on failure. #225

happy-san opened this issue Jan 9, 2021 · 6 comments

Comments

@happy-san
Copy link
Contributor

Version: 0.8.1

πŸ’¬ Description

The program prints βœ“ Successfully generated launcher icons even when it fails during execution.

Output

════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.8.0)
════════════════════════════════════════════

β€’ Creating default icons Android

βœ“ Successfully generated launcher icons
Unhandled exception:
FileSystemException: Cannot open file, path = 'assets/icon/icon.png' (OS Error: No such file or directory, errno = 2)
#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 createDefaultIcons (package:flutter_launcher_icons/android.dart:35:50)
#4 createIconsFromConfig (package:flutter_launcher_icons/main.dart:99:5)
#5 createIconsFromArguments (package:flutter_launcher_icons/main.dart:58:7)
#6 main (file:///sysroot/home/uprowerp/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.8.1/bin/main.dart:6:3)
#7 _startIsolate. (dart:isolate-patch/isolate_patch.dart:299:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
pub finished with exit code 255

πŸ“œ Pubspec.yaml

Well, this issue depends on the pubspec file being intentionally wrong.

@MarkOSullivan94
Copy link
Collaborator

@happy-san can you try with the latest version (v0.9.1) please?

@happy-san
Copy link
Contributor Author

Sure. I'll report back.

@happy-san
Copy link
Contributor Author

@MarkOSullivan94 The bug is still there.

$ flutter pub run flutter_launcher_icons:main
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.9.1)                               
  ════════════════════════════════════════════
  
β€’ Creating default icons Android

βœ“ Successfully generated launcher icons
Unhandled exception:
FileSystemException: Cannot open file, path = 'assets/recipe.pn' (OS Error: No such file or directory, errno = 2)
#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:5)
#6      createIconsFromArguments (package:flutter_launcher_icons/main.dart:60:7)
#7      main (file:///sysroot/home/harpreet/lib/flutter/stable/.pub-cache/hosted/pub.dartlang.org/flutter_launcher_icons-0.9.1/bin/main.dart:6:3)
#8      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:281:32)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
pub finished with exit code 255

@happy-san
Copy link
Contributor Author

happy-san commented Jul 26, 2021

I think I've found the reason behind this:

The success message is being printed in the finally block here

    try {
      createIconsFromConfig(yamlConfig);
    } catch (e) {
      stderr.writeln(e);
      exit(2);
    } finally {
      print('\nβœ“ Successfully generated launcher icons');
    }

Following update ought to fix this:

    try {
      createIconsFromConfig(yamlConfig);
      print('\nβœ“ Successfully generated launcher icons');
    } catch (e) {
      stderr.writeln('\nβœ• Could not generate launcher icons\n$e');
      exit(2);
    } 

This finally block would cause the same issue.

@MarkOSullivan94
Copy link
Collaborator

@happy-san feel free to commit a PR to get this merged in πŸ₯³

happy-san added a commit to happy-san/flutter_launcher_icons that referenced this issue Jul 28, 2021
@happy-san
Copy link
Contributor Author

Should be fixed by #274

iamSahdeep added a commit to GoHighLevel/flutter_launcher_icons that referenced this issue Apr 12, 2023
* Allow compatible args dependency

* Upgrade args dependency

* Also update the main message

* Renamed default example -> default_example as you couldn't use default with flutter create . command

* Reduced size of examples

* Update README.md

Added info to handle incompatible dependency versions

* Fix: Success message printed on exception  (fluttercommunity#225)

* Update README.md

* Updated README & changelog

* Update ios.dart

added missing icons sizes

* added missied sizes for iOS

* add: fallback to local.properties

* add: error message if minSdkValue is not found

* fix: Incorrect version number shown

Thanks to build_version and build_runner the version number is automatically generated after running build_runner and should _hopefully_ be easier to update

Refs: fluttercommunity#350

* Update README.md

* fix: ignore commented minSdkVersion

* style(analysis): formatted

* chore(lints): disabled `sort_constructors_first`

* chore(vscode): add vscode workspace config

* vendor(deps): added new dependencies

checked_yaml,json_annotation for typesafe configs,
cli_util for logging

* feat(web): constants for web platform

* feat(logger): added logger

* feat(web): support for web icons

* feat(cli-option): added --prefix option

--prefix Generates icons in the given path. Used for testing in virtual directory.

Only supports web platform for now

* fix(config): type error when invalid config is passed

* vendor(deps): added test dependencies

* test(fli_config): added tests for fli config

* test(utils): added tests for utils

* test(web): added tests for web icon templates

* fix(logging): added verbose logging to platform failure

* vendor(deps): added mokito for tests

* test(icon_generator): added tests for IconGenerator

* test(web): added tests for web icon generator

* test: added common entrypoint to all tests

This can be used to generate code coverage reports

* chore: setting up automatic deployment of newly published github release

* style: add missing space

Co-authored-by: Mark O'Sullivan <mos182@hotmail.co.uk>

* fix(generator):  fixed typo in a method

* fix(lint): filxed lint warnings for `public_member_api_docs`

* fix(lint): filxed lint warnings for `require_trailing_commas`

* style: sorted imports

* style: sort variable order

* chore(lint): fixed Markdown lint warnings

* docs(web): added web documentation

* ci: added workflow for auto running tests and analyzer for newly opened prs to merge into  master

* chore(test): fix duplicate test runs

* fix tests

* feat(windows): add support for windows closes fluttercommunity#380

* test(windows): added tests for windows

* fix: typos

* style: use relative imports

* refactor: `kWindowsIconSize` to `windowsDefaultIconSize`

* test: checking version number is matching one in pubspec.yaml

* Update lib/main.dart

Co-authored-by: Ratakondala Arun <ratakondalaarun@gmail.com>

* docs(windows): added windows docs

* refactor: renaming method to convert pubspec to map

* fix(android): minSdk not found closes fluttercommunity#384

* style: formatted

* docs(android): added `min_sdk_android` config docs

* docs(android): added `remove_alpha_ios` config docs

closes fluttercommunity#386

* docs(android): added `min_sdk_android` config to example

* Update README.md

fluttercommunity#231 (comment)

From the insight given in the issue above

* refactor:  changed functions to private

* feat(configs):  added new configs to `FlutterLauncherIconsConfig`

added `min_sdk_android` and `remove_alpha_ios` to `FlutterLauncherIconsConfig`

* refactor: added 21 as default min_sdk_android

* chore(release): updated docs with `v0.10.0` release

* chore: update default_example's pubspec

* fix loading config from pubspec.yaml

* refactor package to use FlutterLauncherIconsConfig

* test: use matchers instead of actual values

* chore: updated CHANGELOG

* chore: fix markdown lint warnings

* Fix typos

* feat: fli cli improvement

closes fluttercommunity#400

* chore(docs): update docs

* feat(macos): added support for macos icons

closes fluttercommunity#393

* fix: json indentation

closes fluttercommunity#404

* test(windows): rebuild test mocks

* test(macos): added tests

* docs(macos): added macos attributes

* docs: added sections to attributes

* `repository` & `issue_tracker` added to pubspec

* fix the icons 50 and 57 in contents.json

the 50x50 icons are actually meant for ipad, but in our ios.dart they are marked as iphone. while the 57x57 should be 1x and 2x, while in our ios.dart we're using 1x and 3x

* chore: point `issue_tracker` to github issues

* fix(example): added example for pub.dev closes fluttercommunity#402

* Add extra white line at the end of the file as xcode projects favor having an empty line at the end

* test(mocks): rebuild test mocks

* chore(release): updated version to `v0.10.1`

* chore: updated change log

* chore: add change from fluttercommunity#324

* chore(release): update release version to `v0.11.0`

* Update README.md

Co-authored-by: Mark O'Sullivan <mos182@hotmail.co.uk>

* style(format): format sdk version

* remove .DS_Store

* chore: Fixes typo in unit tests

replaces 'invlaidfliConfigTemplate' for 'invalidfliConfigTemplate'

Signed-off-by: Hugo Branco <hugobrancowb@gmail.com>

* chore: βœ‚οΈ Remove unused testing code

Signed-off-by: Hugo Branco <hugobrancowb@gmail.com>

* chore: Formats code running `dart format .`

Signed-off-by: Hugo Branco <hugobrancowb@gmail.com>

* add .pubignore

* refactor: updated dependencies

Had to update the mock dependency as @GenerateNiceMock wasn't working with the previous version

* Don't ignore CHANGELOG.md

Should improve score from 135 to 140/140.
https://pub.dev/packages/flutter_launcher_icons/score

* - Upgraded image:^3.0.2 to image:^4.0.10 and fixed breaking changes done by the upgrade.

* - updated other dependencies

* - downgrade path to 1.8.2

* - updated image to 4.0.11

* - upgraded image to 4.0.13 to fix quality bugs and updated json_serializable to 6.6.1

* - updated image to 4.0.15

* chore: updated test package

* docs: added documentation and disabled linter for some files

* Fix remove alpha for iOS

* chore: updated dependencies to latest

* style: formatted code with `dart format .`

* chore: release prep for v0.13.0

* feat: command to generate config file template

* refactor: added exception handling

* feat: display command to run to use config file

If custom file name is used, then only add `-f` flag to keep it clear

* add support for adaptive icon scaling

* remove alpha and add adaptive background color

* v1.0.0

---------

Signed-off-by: Hugo Branco <hugobrancowb@gmail.com>
Co-authored-by: PiN73 <p97p@ya.ru>
Co-authored-by: Edmon Marine Clota <comlaterra@gmail.com>
Co-authored-by: Mark O'Sullivan <markyosullivan@gmail.com>
Co-authored-by: Mark O'Sullivan <mos182@hotmail.co.uk>
Co-authored-by: Harpreet Sangar <happy_san@protonmail.com>
Co-authored-by: Oleg <oleg.baidalka@gmail.com>
Co-authored-by: Ratakondala Arun <ratakondalaarun@gmail.com>
Co-authored-by: Ben Vercammen <benvercammen@gmail.com>
Co-authored-by: Oleg <130861+bossly@users.noreply.github.com>
Co-authored-by: Adeyanju Akorede <53178226+Lone-Wolf17@users.noreply.github.com>
Co-authored-by: p-mazhnik <pavel.mazhnik@gmail.com>
Co-authored-by: Edward Poot <edwardmp@gmail.com>
Co-authored-by: Pathik Patel <patelpathik1995@gmail.com>
Co-authored-by: adnan <adnanfahedhr@gmail.com>
Co-authored-by: Alexander Saelmans <alexander.saelmans@signify.com>
Co-authored-by: Connectety-T <k8ieunomu@mozmail.com>
Co-authored-by: Hugo Branco <hugobrancowb@gmail.com>
Co-authored-by: Seth Westphal <westy92@users.noreply.github.com>
Co-authored-by: Carlos Humberto <carloshumberto1990@gmail.com>
Co-authored-by: mike-500 <69246756+mike-500@users.noreply.github.com>
Co-authored-by: OutdatedGuy <everythingoutdated@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants