How to solve: This application is modifying the autolayout engine from a background thread. iOS 11..

Hello,
I need to apply this way to debug the autolayout issue: Main problem with "This application is modifying the autolayout engine from a background thread" is that it seem to be logged a long time after the actual problem occurs, this can make it very hard to troubleshoot.

I managed to solve the issue by creating three symbolic breakpoints.

Debug > Breakpoints > Create Symbolic Breakpoint...

Breakpoint 1:

Symbol: -[UIView setNeedsLayout]

Condition: !(BOOL)[NSThread isMainThread]

Breakpoint 2:

Symbol: -[UIView layoutIfNeeded]

Condition: !(BOOL)[NSThread isMainThread]

Breakpoint 3:

Symbol: -[UIView updateConstraintsIfNeeded]

Condition: !(BOOL)[NSThread isMainThread]

With these breakpoints, you can easily get a break on the actual line where you incorrectly call UI methods on non-main thread

But this only works in Xcode is there a way we can do this for Visual Studio? I am using a webview int this page.

2018-07-19 17:08:41.725 Test.iOS[433:56033] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
Stack
0 Foundation 0x000000018404f66c + 96
1 Foundation 0x000000018404fd58 + 32
2 Foundation 0x0000000183e85858 + 176
3 Foundation 0x0000000183e856e0 + 332
4 Foundation 0x0000000183e7bbf4 + 324
5 Foundation 0x0000000183e7b720 + 304
6 Foundation 0x0000000183e7b5b4 + 92
7 UIKit 0x000000018ca48df8 + 668
8 UIKit 0x000000018d4499b4 + 112
9 UIKit 0x000000018d4484dc + 188
10 UIKit
0x000000018d4489a4 + 1008
11 UIKit 0x000000018d44887c + 712
12 UIKit 0x000000018d44887c + 712
13 UIKit 0x000000018d44887c + 712
14 UIKit 0x000000018d44887c + 712
15 UIKit 0x000000018d44887c + 712
16 Foundation 0x0000000183e7c59c + 168
17 UIKit 0x000000018d44913c + 92
18 UIKit 0x000000018d447d28 + 116
19 UIKit 0x000000018d448d58 + 168
20 UIKit 0x000000018d449d84 + 428
21 UIKit 0x000000018cc3aa28 + 180
22 UIKit 0x000000018c959000 + 1256
23 QuartzCore
0x00000001875290b4 + 184
24 QuartzCore 0x000000018752d194 + 332
25 QuartzCore 0x000000018749bf24 + 336
26 QuartzCore 0x00000001874c2340 + 540
27 QuartzCore 0x00000001874c3180 + 92
28 CoreFoundation 0x00000001834f38b8 + 32
29 CoreFoundation 0x00000001834f1270 + 412
30 CoreFoundation 0x00000001834122f8 CFRunLoopRunSpecific + 468
31 WebCore 0x000000018b261ac4 + 456
32 libsystem_pthread.dylib 0x000000018317832c + 308
33 libsystem_pthread.dylib 0x00000001831781f8 + 0
34 libsystem_pthread.dylib 0x0000000183176c38 thread_start + 4
)
An unhandled exception occured.

Thread started: #38
Thread finished: #14
The thread 0xe has exited with code 0 (0x0).
Thread finished: #11
The thread 0xb has exited with code 0 (0x0).
2018-07-19 17:09:01.486 Sharelink.iOS[433:59707] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
Thread finished: #26
The thread 0x1a has exited with code 0 (0x0).
Thread finished: #27
The thread 0x1b has exited with code 0 (0x0).
Thread finished: #33
The thread 0x21 has exited with code 0 (0x0).
Thread finished: #24
The thread 0x18 has exited with code 0 (0x0).
Thread finished: #21
The thread 0x15 has exited with code 0 (0x0).
The app has been terminated.

Best Answers

Answers

Sign In or Register to comment.