zaster
zaster

Reputation: 421

Flutter Widget Inspector - Not displaying

I am using Android Studio 3.1.3 and my flutter inspector doesn't show anything in it.

https://flutter.io/inspector/#flutter-widget-inspector

select widget button etc... are not appearing.(However flutter outline is wokring)

I have installed both flutter and dart plugins.

Upvotes: 18

Views: 48567

Answers (11)

dadaocao
dadaocao

Reputation: 11

If you use a real device to debug like me, try to open another virtual imulatior/emulator on your computer you can close it as soon as it's opened, it will wake up your sleeping inspector in VS Code.

Upvotes: 1

Daren
Daren

Reputation: 31

My solution here:

  1. go 'preference' > 'setting'
  2. type 'flutter' to search
  3. in 'Dart' > 'DevTools' > 'Open Dev Tools'
  4. select 'flutter'.
  5. re-debug the application

preference>setting>search flutter

Upvotes: 0

MARCOS RANGEL
MARCOS RANGEL

Reputation: 1

I had the same error after several tests, comparing the configuration files I realized that the error was in my launch.json configuration file.

   "version": "0.2.0",
 "settings": [
     {
         "name": "main",
         "type": "dart",
         "request": "launch",
         "program": "lib/main.dart"
     },
     {
         "name": "portal_amazonas Debug",
         "request": "launch",
         "type": "dart",
         "args": [
             "--flavor",
             "portal_amazonas"
         ],
         "program": "lib/flavors/main_portal_amazonas.dart"
     },
     {
         "name": "portal_amazonas",
         "request": "launch",
         "type": "dart",
         "flutterMode": "profile",
         "args": [
             "--flavor",
             "portal_amazonas"
         ],
         "program": "lib/flavors/main_portal_amazonas.dart"
     },
     {
         "name": "control_care Debug",
         "request": "launch",
         "type": "dart",
         "args": [
             "--flavor",
             "control_care"
         ],
         "program": "lib/flavors/main_control_care.dart",
     },
     {
         "name": "control_care",
         "request": "launch",
         "type": "dart",
         "flutterMode": "profile",
         "args": [
             "--flavor",
             "control_care"
         ],
         "program": "lib/flavors/main_control_care.dart",
     },

     {
         "name": "Run all tests",
         "type": "dart",
         "request": "launch",
         "program": "test/",
     },
 ]

}

See that the parameter "flutterMode": "profile" which could be "flutterMode": "debug", or "flutterMode": "release",

After removing this parameter everything returned to normal.

OBS: in my case I have flavors configured

Upvotes: 0

Allan Garcia
Allan Garcia

Reputation: 568

Flutter inspection is not working, all suggested workarounds above already tested.

Android 2021.3.1 Patch 1 Flutter installer 3.3.6-stable

Error:

enter image description here

When I click in the suggested link:

enter image description here

My Current Android Installation:

enter image description here

My hardware is a M1 MacBook Pro 8GB, 512HD, no issues into running the app itself, just the Inspector not working.

Any Ideas? Should I make this into a Question? I preferred to keep in the thread.

Upvotes: 0

Oleg Romanov
Oleg Romanov

Reputation: 1

A very rough but always valid fix is to change to a different version of the SDK (and then back, if necessary).

flutter channel master && flutter channel stable

Upvotes: 0

Muhammad Nabeel
Muhammad Nabeel

Reputation: 790

  1. Android Studio > Preferences > Languages & Frameworks > Flutter > App Execution > Open Flutter Inspector view on launch

  2. Close and Relaunch Android Studio > Open any Flutter Project > Open iOS Simulator or Android Emulator and Run Debug Mode

  3. View > Tool Window > Flutter Inspector

PS: In order for something to show up in the Flutter Inspector, your app has to be running on a Device or on a Simulator or Emulator.

Upvotes: 35

Lou
Lou

Reputation: 113

I'm having same issue with flutter 2.10.5. I think this is a bug related to flutter plugin. alternatively, you can use Flutter inspector on browser by clicking Flutter Performance Tab, Open Devtools

Upvotes: 0

Maruf Hassan
Maruf Hassan

Reputation: 1248

This helped me get it back to work in VSCode.

  1. Stop the emulator if you are running the app.
  2. Run flutter clean in your terminal
  3. Run the app again.
  4. Open Command Palette in VS Code by pressing F1
  5. Search for Dart: Open Dev Tools and click enter
  6. Click Open Widget Inspector Page

The Widget Inspector will now display the Widget Tree.

Upvotes: 2

Alex Tan
Alex Tan

Reputation: 39

The following steps helped me to get Flutter Inspector Widget Tree back:

File -> Settings -> Languages & Frameworks -> Flutter:

Enable (Check) "Open Flutter Inspector view on app launch" checkbox

Disable (Uncheck) "Disable tracking widget creation locations" checkbox

Stop, start the app again.

Upvotes: 3

vovahost
vovahost

Reputation: 36017

I had the same problem and looks like toggling on and off Show repaint Rainbow is fixing it and renders the widget tree. Flutter Performance screenshot

Upvotes: 2

Dhrumil Shah - dhuma1981
Dhrumil Shah - dhuma1981

Reputation: 15789

To make Flutter Widget Inspector work.

  1. Run the App.
  2. Check the emulator/simulator which screen is on.
  3. Select the respected file from the Left side - Project Explorer

And you will be able to see the Flutter Widget Inspector working :)

P.s. It is still not working, Select RenderTree or Performance and then Widget. It will get refreshed. This is how it is working at my end.

Upvotes: 4

Related Questions