56

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

orelzion
  • 2,452
  • 4
  • 30
  • 46

11 Answers11

61

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.

shubhamgarg1
  • 1,619
  • 1
  • 15
  • 20
  • Restart of Android Studio needed after installation of the component to make it work. Though Android Studio did not mention it. – Doron Ben-Ari Jul 15 '23 at 21:57
23

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

Bruno
  • 3,872
  • 4
  • 20
  • 37
DungPhan
  • 356
  • 3
  • 5
18

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

Yazon2006
  • 3,684
  • 3
  • 25
  • 36
Daniele
  • 1,063
  • 1
  • 10
  • 22
  • This helped me so that at least AS would show a clue of what was going on – Chisko Sep 17 '20 at 18:15
  • 2
    To others, you'll see this dialog in A/S if you unplug device after "trying" to start Layout Inspector. Daniele didn't just pull these out of no where =) – tir38 Sep 23 '20 at 01:35
  • 1
    Yup, I just had no time to argument the answer, sorry :) – Daniele Sep 30 '20 at 08:34
7

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

haolianglearn
  • 91
  • 2
  • 7
3

Simply restarting Android Studio seems to solve the issue.

Ivan Bartsov
  • 19,664
  • 7
  • 61
  • 59
2

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

jameseronious
  • 219
  • 2
  • 5
0

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

Abdul Rahman Shamair
  • 580
  • 1
  • 11
  • 22
0

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

MiddleD.
  • 315
  • 1
  • 4
  • 21
0

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

Tobias Reich
  • 4,952
  • 3
  • 47
  • 90
-1

try this: adb shell setenforce 0 (disable SELinex

-1

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.

Narthall
  • 9
  • 1
  • 4
  • "me too" does not answer question – Dominic Cerisano May 18 '22 at 18:31
  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/31764007) – Skylar Ittner May 19 '22 at 23:11