orelzion
orelzion

Reputation: 2532

Android Studio 4.0 Layout Inspector isn't working

I can't see any updates in Layout Inspector in the new Android studio (4.0).

My app is targeting API 29, and build tools version is buildToolsVersion '29.0.3'.

I'm running emulator Pixel_2_api_29 and my device MI A3 OS version 10.

And this is all I can see layout inspector android studio 4.0

Upvotes: 62

Views: 48936

Answers (10)

Ivan Bartsov
Ivan Bartsov

Reputation: 21036

Simply restarting Android Studio seems to solve the issue.

Upvotes: 4

Tobias Reich
Tobias Reich

Reputation: 5160

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:

enter image description here

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.

enter image description here

Upvotes: -1

MiddleD.
MiddleD.

Reputation: 383

In some cases you can resolve this issue to connect device by name instead of connecting by ip.

Upvotes: -1

haolianglearn
haolianglearn

Reputation: 97

I hit on same issue. And above solutions doesn't work for me. It is resolved by reinstall the app

Upvotes: 7

jameseronious
jameseronious

Reputation: 289

Make sure android:hardwareAccelerated="false" isn't in your manifest file.

Upvotes: 3

Abdul Rahman Shamair
Abdul Rahman Shamair

Reputation: 578

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.

  1. open ~/.bash_profile or open $HOME/.zshrc (depending upon your file system)
  2. Add:
Hierarchy Viewer Variable

export ANDROID_HVPROTO=ddm

source ~/.bash_profile
  1. source ~/.bash_profile or source $HOME/.zshrc

For original answer click here: Credits

Upvotes: 0

tingting
tingting

Reputation: 1

try this: adb shell setenforce 0 (disable SELinex

Upvotes: -3

shubhamgarg1
shubhamgarg1

Reputation: 1995

In the tools->SDK Manager window, please verify that Layout Inspector Image Server for API 29-30 is installed.

enter image description here

In case you still face the issue, take a look at the Run window and if you see a dlopen error for a library, add android:extractNativeLibs="true" in your AndroidManifest.xml file.

Upvotes: 75

DungPhan
DungPhan

Reputation: 356

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:

  1. when error: enter image description here

  2. and after stop and run Debug again: enter image description here

Upvotes: 23

Daniele
Daniele

Reputation: 1063

Try with adb shell settings delete global debug_view_attributes and adb shell settings delete global debug_view_attributes_application_package enter image description here

Upvotes: 18

Related Questions