Dart-Code: "Failed to initialize Flutter: Process exited with code 1" after upgrade to Flutter 1.22

Steps to Reproduce

  1. Upgrade to Flutter 1.22 on Stable channel
  2. Flutter doctor
  3. Open any project in VS Code (1.49.2)
  4. Error: “Failed to initialize Flutter: Process exited with code 1.”

Restarting, flutter clean, uninstall re-install Flutter Extension, all have no effect. Thanks very much for all the hard work!

Logs

flutter doctor --verbose
[✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale en-CN)
    • Flutter version 1.22.0 at /Users/Orca/flutter/flutter/flutter
    • Framework revision d408d302e2 (2 days ago), 2020-09-29 11:49:17 -0700
    • Engine revision 5babba6c4d
    • Dart version 2.10.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/Orca/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.3

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.49.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.15.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

@tony123S it looks like the engine.version file in your SDK contains Git conflict markers (this could happen if something tried to merge two Git branches together - though I’m not sure how that would occur).

The easiest way to fix this would be to re-extract the SDK if you got it from a zip. Running git reset --hard 2.0.1 from the terminal inside your Flutter SDK folder would probably also work (note: this will discard any local modifications in your Flutter SDK, though unless you’re contributing to the Flutter SDK I would not expect you to have any).

thanks @DanTup !! that has solved the problem!

Using git clean and git pull related commands didn’t work, but deleting the flutter folder and downloading a fresh copy of Flutter to install solved the problem. Thanks so much Dan!

At a later time I’ll try to get the git version of flutter working.