Skip to content

"Unary operator expected" with flutter command #15081

@HZooly

Description

@HZooly

Steps to Reproduce

Using flutter command like flutter run in a project, and got the following error: /Users/Hugo/flutter/bin/flutter: line 75: [: !=: unary operator expected.

The instruction stills executing. In example, flutter analyze displays this bash error, but keep analyzing project.

Logs

No issues found! with flutter analyze

Flutter Doctor

$ flutter doctor -v
/Users/Hugo/flutter/bin/flutter: line 75: [: !=: unary operator expected
[✓] Flutter (Channel beta, v0.1.5, on Mac OS X 10.13.4 17E160e, locale fr-FR)
    • Flutter version 0.1.5 at /Users/Hugo/flutter
    • Framework revision 3ea4d06340 (8 days ago), 2018-02-22 11:12:39 -0800
    • Engine revision ead227f118
    • Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.

[!] iOS toolchain - develop for iOS devices
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    • ios-deploy 1.9.1
    ✗ ios-deploy out of date (1.9.2 is required). To upgrade:
        brew upgrade ios-deploy
    • CocoaPods version 1.4.0

[✗] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).

[✓] VS Code (version 1.20.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Dart Code extension version 2.9.2

! Doctor found issues in 3 categories.

As you can see, I'm running Flutter on macOS 10.13.4 in iTerm 2.

I know my issue can be related to #13822, but Flutter doesn't exit in my case.

It concerns this line in flutter file:

if [ ! -f "$SNAPSHOT_PATH" ] || [ ! -s "$STAMP_PATH" ] || [ `cat "$STAMP_PATH"` != "$revision" ] || [ "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]; then

Metadata

Metadata

Assignees

Labels

toolAffects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions