invertase / flutterfire_cli

A CLI to help with using FlutterFire in your Flutter applications.
Apache License 2.0
170 stars 47 forks source link

[bug]: flutterfire update throws ProcessException: System cannot find the specified file. #252

Open iamalper opened 9 months ago

iamalper commented 9 months ago

Is there an existing issue for this?

CLI Version

0.2.7

Firebase Tools version

12.9.1

Flutter Doctor Output

[√] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22631.2861], locale tr-TR) • Flutter version 3.16.5 on channel stable at C:\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 78666c8dc5 (10 days ago), 2023-12-19 16:14:14 -0800 • Engine revision 3f3e560236 • Dart version 3.2.3 • DevTools version 2.28.4

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at C:\Android\Sdk • Platform android-34, build-tools 34.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231) • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[√] Visual Studio - develop Windows apps (Visual Studio Derleme Araçları 2022 17.8.1) • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools • Visual Studio Derleme Araçları 2022 version 17.8.34316.72 • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.3) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.85.1) • VS Code at C:\Users\Alper\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.80.0

[√] Connected device (2 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.2861] • Edge (web) • edge • web-javascript • Microsoft Edge 120.0.2210.91

[√] Network resources • All expected network resources are available.

Description

When i run flutterfire update command in a flutter project i get following output

Cleaning up current workspace ... Unhandled exception: ProcessException: System cannot find the specified file.

Command: flutter clean

0 _ProcessImpl._start (dart:io-patch/process_patch.dart:402:33)

1 Process.start (dart:io-patch/process_patch.dart:38:20)

2 _runNonInteractiveProcess (dart:io-patch/process_patch.dart:579:18)

3 Process.run (dart:io-patch/process_patch.dart:49:12)

4 UpdateCommand.run (package:flutterfire_cli/src/commands/update.dart:79:19)

5 CommandRunner.runCommand (package:args/command_runner.dart:212:27)

6 CommandRunner.run. (package:args/command_runner.dart:122:25)

7 new Future.sync (dart:async/future.dart:305:31)

8 CommandRunner.run (package:args/command_runner.dart:122:14)

9 main (file:///C:/Users/Alper/AppData/Local/Pub/Cache/hosted/pub.dev/flutterfire_cli-0.2.7/bin/flutterfire.dart:57:48)

### Steps to reproduce 1. Create a new flutter project 2. Run `flutterfire configure` and follow steps 3. Run `flutterfire update` 4. See error ### Expected behavior `flutterfire update` shouldn't throw error at command `flutter clean`. Normally `flutter clean` runs without any issue. ### Screenshots _No response_ ### Additional context and comments _No response_
wayne-wang-1119 commented 8 months ago

same bug here dont know what to do

jibbers42 commented 7 months ago

The command needs to be updated to work on Windows and *nix.

This issue is caused by dart not using PATHEXT, https://github.com/dart-lang/sdk/issues/31291. The code should run flutter.bat when on Windows: https://github.com/invertase/flutterfire_cli/blob/32fde77008b5a28d6ba856dae9f7a678dc0fbe0d/packages/flutterfire_cli/lib/src/commands/update.dart#L79-L80

Also, the next command won't work because rm is not a windows command: https://github.com/invertase/flutterfire_cli/blob/32fde77008b5a28d6ba856dae9f7a678dc0fbe0d/packages/flutterfire_cli/lib/src/commands/update.dart#L83-L84

And a couple more Process lines in that file that won't work on Windows. Not sure about other commands.

russellwheatley commented 7 months ago

@iamalper - is this on windows machine?

iamalper commented 7 months ago

@russellwheatley yes, windows 11 single language

russellwheatley commented 5 months ago

Hey @jibbers42 - if you would like to open a PR updating the commands for windows machine, I'd take a look 👍

nickf2k commented 2 months ago

Hi, does it has any quick fix for this? I can not run flutterfire configure due to this error