実現したいこと
- There are multiple observatory ports available.Rerun this command with one of the following passed in as the appId:
flutter attach --app-id com.example.chatApp
flutter attach --app-id com.example.chatApp (2)を解決したい。
前提
Flutterで出力結果を新しいものへ反映させるために、ホットリロードを実行したところ、There are multiple observatory ports available.
Rerun this command with one of the following passed in as the appId:
flutter attach --app-id com.example.chatApp
flutter attach --app-id com.example.chatApp (2)が発生。1時間ほどいくつか参考サイトを参照したものの解決できない。
発生している問題・エラーメッセージ
There are multiple observatory ports available. Rerun this command with one of the following passed in as the appId: flutter attach --app-id com.example.chatApp flutter attach --app-id com.example.chatApp (2)
該当のソースコード
launch.json
1{ 2 // IntelliSense を使用して利用可能な属性を学べます。 3 // 既存の属性の説明をホバーして表示します。 4 // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "name": "chat_app", 9 "request": "attach", 10 "type": "dart", 11 "args": ["--app-id", "com.example.chatApp"], 12 }, 13 { 14 "name": "chat_app (profile mode)", 15 "request": "launch", 16 "type": "dart", 17 "flutterMode": "profile" 18 }, 19 { 20 "name": "chat_app (release mode)", 21 "request": "launch", 22 "type": "dart", 23 "flutterMode": "release" 24 } 25 ] 26}
試したこと
Flutter runの出力結果が変わらないため、ホットリロードを実行。
表題のエラーが発生したため、以下のサイトを参照。
launch.jsonを作成し、再度ホットリロードを実行。
参照したサイトをもとにlaunch.json11行目に"args": ["--app-id", "com.example.chatApp"],の一文を追加し、ホットリロード(flutter attach --app-id com.example.chatApp)を再実行したものの同様のエラー発生し解決できず。
有識者のアドバイスから、launch.json9行目を"request": "launch"から"request": "attach"に修正し再度ホットリロードするも同様のエラーメッセージ発生。
補足情報(FW/ツールのバージョンなど)
[✓] Flutter (Channel stable, 3.7.8, on macOS 13.2.1 22D68 darwin-x64,
locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] VS Code (version 1.76.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
エラーメッセージで参照したページ
launch.jsonファイルの作り方で参照したページ
https://amateur-engineer-blog.com/vscode-launchjson/
ホットリロードのやり方で参照したページ
https://qiita.com/Statham/items/46812e0aab4862d44709
bundle IDの確認方法で参照したページ
https://zenn.dev/captain_blue/articles/checking-bundle-id-in-flutter

あなたの回答
tips
プレビュー