YehudaKremer / msix

Create Msix installer for flutter windows-build files.
https://pub.dev/packages/msix
MIT License
276 stars 68 forks source link

[BUG] RangeError (end): Invalid value: Not in inclusive range 0..1: -3 #203

Closed gslender closed 1 year ago

gslender commented 1 year ago

Running msix 3.14.0 on a cmd line I get this... ??

But I think this is because I have fvm folder present in the project, but the windows host isn't configured (yet) for fvm. I wasn't actually planning to use it that way as its the CI/CD machine that doesn't need to switch flutter versions all the time - so fvm isn't installed. If that's the reason for the below error, is it possible to add a --ignore_fvm switch to allow the library to run / build without following the .fvm folder configurations?

Building package executable... (3.5s)
Built msix:create.
Unhandled exception:
RangeError (end): Invalid value: Not in inclusive range 0..1: -3
#0      RangeError.checkValidRange (dart:core/errors.dart:365:9)
#1      List.sublist (dart:core-patch/growable_array.dart:84:38)
#2      WindowsBuild.build (package:msix/src/windows_build.dart:27:19)
#3      Msix._buildMsixFiles (package:msix/msix.dart:103:52)
#4      Msix._createMsix (package:msix/msix.dart:98:11)
#5      Msix.create (package:msix/msix.dart:57:11)
<asynchronous suspension>
#6      main (file:///C:/Users/gslen/AppData/Local/Pub/Cache/hosted/pub.dev/msix-3.14.0/bin/create.dart:4:3)
<asynchronous suspension>
The system cannot find the path specified.
YehudaKremer commented 1 year ago

Hello @gslender

Tanks you for reporting this bug 👍

I published new version (3.14.1) with a fix, please see if its solve the problem.

YehudaKremer commented 1 year ago

@Tienisto hey 😄

Maybe on CI/CD machines sometime the Dart and Flutter are positioned is unexpected locations.

I added a fallback and validation to the Flutter path resolution here: https://github.com/YehudaKremer/msix/commit/7e92155b8e377bf529f8dfa9e615d46ab88e0908#diff-d8263713a1bc11d9abc4d48bcd3ae36df8d88dcd470930b4af97433eefa03166

Please take a look if you have time, Thanks 🙏

Tienisto commented 1 year ago

Alright, your proposed fix looks good 👍

YehudaKremer commented 1 year ago

Hello @gslender

We publish a fix in version 3.14.1, please update if the problem reproduces.

Thank you 👍