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
2.01k stars 406 forks source link

[BUG] Execution fails when renaming the default Runner project #543

Open ManuelRauber opened 9 months ago

ManuelRauber commented 9 months ago

:information_source: Info

Version: e.g. v0.13.1

:speech_balloon: Description

Flutters allows to rename the Runner.xcodeproj folder. If you do so, the execution of flutter_launcher_icons fails:

Unhandled exception:
PathNotFoundException: Cannot open file, path = 'ios/Runner.xcodeproj/project.pbxproj' (OS Error: No such file or directory, errno = 2)
#0      _checkForErrorResponse (dart:io/common.dart:55:9)
#1      _File.open.<anonymous closure> (dart:io/file_impl.dart:381:7)
<asynchronous suspension>
#2      _File.readAsBytes.<anonymous closure> (dart:io/file_impl.dart:562:24)
<asynchronous suspension>
#3      _File.readAsString (dart:io/file_impl.dart:621:18)
<asynchronous suspension>
#4      LineSplitter.convert (dart:convert/line_splitter.dart:52:3)
<asynchronous suspension>
#5      changeIosLauncherIcon (package:flutter_launcher_icons/ios.dart:149:30)
<asynchronous suspension>

It would be nice, if this package does support renaming the Runner project as well.

bielcarpi commented 1 month ago

As a temporary workaround, we can:

cd ios
ln -s Your-Project.xcodeproj Runner.xcodeproj

And then run the script. Finally, delete the symlink.