Xcode Debug View Hierarchy: Unable to capture view hierarchy
Asked Answered
S

3

9

While trying to debug my view hierarchy, I get the following error:

Error: Unable to capture view hierarchy. Details: No plist data for fetching view hierarchy: error evaluating expression “(id)[(Class)objc_getClass("DBGViewDebuggerSupport_iOS") fetchViewHierarchyWithOptions:(id)[(Class)objc_getClass("NSDictionary") dictionaryWithObjects:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:1]] arrayByAddingObject:(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:@"_UIVisualEffectBackdropView"] arrayByAddingObject:@"_UIBackdropEffectView"]] arrayByAddingObject:(id)[(Class)objc_getClass("NSNumber") numberWithBool:0]] forKeys:(id)[(id)[(id)[(Class)objc_getClass("NSArray") arrayWithObject:@"DBGViewDebuggerUseLayersAsSnapshots"] arrayByAddingObject:@"DBGViewDebuggerEffectViewsToSnapshotAsImage"] arrayByAddingObject:@"DBGViewDebuggerAlwaysEncodeLayers"]]]”: error: Execution was interrupted, reason: signal SIGSTOP. The process has been returned to the state before expression evaluation. Method: -[DBGAbstractViewDescriber handleFetchedViewInfo:fetchError:resultHandler:] Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

Anyone got a clue?

Xcode Version 8.2.1 (8C1002)
Simulator: iPhone 6 (10.2)

Thanks!

Scopoline answered 22/2, 2017 at 2:23 Comment(1)
The error message asks you to file a bug report with Apple. I suggest you do so.Gang
A
2

Actually me also got the same type of error, but the truth is our app must in Running state. Because the "Debug View capture hierarchy" area appears only while the app is running.

See my screen shot

In Step 1: Select your app first

In Step 2: Now select Debug hierarchy button

enter image description here

If this doesn't work then go to Debug in menu on the top bar of Xcode

->Debug -> view debugging -> Capture View Hierarchy

I solved my problem like this.

Airbrush answered 4/1, 2019 at 6:12 Comment(1)
That also doesn't work for me. I get an error with both methods: Unable to capture the view hierarchy Domain: DBGViewDebuggerErrorDomain Code: 0 Failure Reason: "MyApp" encountered an unexpected error when processing the request for a view hierarchy snapshot. User Info: { DVTErrorCreationDateKey = "2023-01-09 20:30:43 +0000"; DVTRadarComponentKey = 547420; Environment = "Xcode 14.0 (14A309) debugging iPhone 13 Pro iOS 16.0 (20A362)."; }Asleyaslope
G
1

Since Apple Silicon can run iOS apps natively, you want to debug its views too. If you use Xcode in fullscreen mode, your app will change state and become inactive when you switch focus. So as @iOS said, you can't get the snapshot.

Just keep Xcode and iOS app in the same workspace (or on desktop), so iOS app will be in focus. It is still laggy for me, but maybe it is current Xcode's fault.

Glycol answered 30/3, 2021 at 6:37 Comment(2)
That also doesn't work for me. I get an error with both methods: Unable to capture the view hierarchy Domain: DBGViewDebuggerErrorDomain Code: 0 Failure Reason: "MyApp" encountered an unexpected error when processing the request for a view hierarchy snapshot. User Info: { DVTErrorCreationDateKey = "2023-01-09 20:30:43 +0000"; DVTRadarComponentKey = 547420; Environment = "Xcode 14.0 (14A309) debugging iPhone 13 Pro iOS 16.0 (20A362)."; }Asleyaslope
Removing xcode and simulator from fullscreen mode to normal mode fixed this issue for me.Appendage
F
0

For large projects , generally this issue happens , even in updated xcode version this issue still exists. For solution you can try below methods ,

  1. Instead on click on Debug View Hierarchy icon in xcode , Go Debug -> View Debugging -> Capture View Hierarchy
  2. Try to use xcode in maximized size.
  3. Minimize both left and right navigators window.
Football answered 14/8 at 15:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.