Android Layout Inspector fails with timeout error

I had the same issue on Android Studio 3.4, but I was able to use the Layout Inspector on Android Studio 3.5 Beta 1 without any problems.

I am working with a very complex view, so I suspect that is what led to the trouble on Android Studio 3.4. Both the failure I saw and the success were with a physical device.


Found a really strange solution.

Open your app, go to android home screen, open another app, now use Layout inspector in Android Studio.

It worked and I see my app's view hierarchy.

UPDATE

P.Melch claims that you don't even need to open another app, try just sending your app to background.