Skip to content

Instantly share code, notes, and snippets.

@Jedt3D
Last active June 4, 2024 04:08
Show Gist options
  • Save Jedt3D/6ee4c0418eae84f66db4a6e8dc87c9ae to your computer and use it in GitHub Desktop.
Save Jedt3D/6ee4c0418eae84f66db4a6e8dc87c9ae to your computer and use it in GitHub Desktop.
How to fix flutter, git path and web target is not running

Fix flutter and git path not found

  • Open Windows Terminal as Run as Administrator
  • Run this command

    git config --global --add safe.directory C:/flutter

  • Close and open IntelliJ again.
  • Go to IntelliJ Setting and check these..
    • Language & Frameworks > Android SDK is set properly and show android sdk version
    • If it's not, cliek Edit and it should find the installed version already and Next Next Next.
    • Language & Frameworks > Flutter SDK is set properly and show flutter version
    • If Flutter SDK is not set, set it before Dart SDK
    • Now check Language & Frameworks > Dart SDK, it should be automatically set and show dart version
  • If it ask you about it can not find Android SDK version 29, you can set it to version 34. It was installed automatically with Android Studio yesterday.

fix flutter web is unable to work

  • Google Chrome, install an Extension name Dart Debug Extension
  • If you still can not run Flutter : Chrome(Web) target, go to Edit configurations. It's located next to Run button on toolbar, under the main.dart file name.
  • Set the Additional Run Argument to -d web-server now it should run successfully. You may still get a white blank page though.
  • Click the http://localhost:##### to open the browser and then click the Dart Debug Extension icon to refresh the page

Flutter と git パスが見つからない問題を修正

  • Windows ターミナル管理者として実行 として開きます
  • このコマンドを実行します

    git config --global --addsafe.directory C:/flutter

  • IntelliJ を閉じて、再度開きます。
  • IntelliJ 設定に移動し、これらを確認します。
    • 言語とフレームワーク > Android SDK が適切に設定されている アンドロイド SDK バージョンを表示
    • そうでない場合は、「編集」をクリックすると、すでにインストールされているバージョンと「次へ 次へ」が見つかるはずです。
    • 言語とフレームワーク > Flutter SDK が適切に設定されている および Flutter バージョンを表示
    • Flutter SDK が設定されていない場合は、Dart SDK より前に 設定してください
    • ここで、[言語とフレームワーク] > [Dart SDK] を確認します。自動的に設定されるはずです Dart のバージョンが表示されます
  • Android SDK バージョン 29 が見つからないというメッセージが表示された場合は、バージョン 34 に設定できます。昨日、Android Studio で自動的にインストールされました。

Flutter Web が動作しない問題を修正

  • Google Chrome、拡張機能名 Dart Debug Extension をインストールします
  • それでも Flutter : Chrome(Web) ターゲットを実行できない場合は、構成の編集 に進みます。これは、ツールバーの [実行] ボタンの横、main.dart ファイル名の下にあります。
  • 追加の実行引数-d web-server に設定すると、正常に実行されるはずです。ただし、まだ白い空白ページが表示される場合があります。
  • http://localhost:##### をクリックしてブラウザを開き、Dart デバッグ拡張機能アイコンをクリックしてページを更新します。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment