'Android Studio 4.0 Layout Inspector isn't working
Solution 1:[1]
Try to stop current running-app and run with debug mode again (click button "Debug" or press Shift F9) and select your process again. Please see some screenshots below:
when error:

and after stop and run Debug again:

Solution 2:[2]
Try with
adb shell settings delete global debug_view_attributes
and
adb shell settings delete global debug_view_attributes_application_package

Solution 3:[3]
I hit on same issue. And above solutions doesn't work for me. It is resolved by reinstall the app
Solution 4:[4]
Make sure android:hardwareAccelerated="false" isn't in your manifest file.
Solution 5:[5]
Simply restarting Android Studio seems to solve the issue.
Solution 6:[6]
If you are unable to view the Flutter Inspector and are seeing something like "Installing DevTools" on a Mac system. You have to add following environment variable.
- open
~/.bash_profileor open$HOME/.zshrc(depending upon your file system) - Add:
Hierarchy Viewer Variable
export ANDROID_HVPROTO=ddm
source ~/.bash_profile
- source
~/.bash_profileor source$HOME/.zshrc
For original answer click here: Credits
Solution 7:[7]
In some cases you can resolve this issue to connect device by name instead of connecting by ip.
Solution 8:[8]
It seems to be a different issue than what I see in your screenshot but maybe others have this issue, too.
One can sometime notice, the layout fetch seems to have finished but nothing is shown in the inspector. The reason then seems to be the graphical representation and not the inspector itself. So if you get something like this:
where the zoom controls are visible but somehow no layout is appearing, try pressing the "Zoom to fit" button. It then re-scales the view which leads to a redraw. At least in my configuration for devices below API 29 (which have no "Live update") this is necessary in order to see something.
Solution 9:[9]
In case just like me you stumble on this topic trying to code a Flutter app, I did not manage to make it work either.
Instead, you can use the Flutter Inspector which provides a minimal set of similar functionalities.
Solution 10:[10]
try this: adb shell setenforce 0 (disable SELinex
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow



