question

MGBhadurudeen-1345 avatar image
0 Votes"
MGBhadurudeen-1345 asked ·

What is 'Layout Cycle detected' & how to get rid of this?

I regularly get complaints from my users that my app is frequently crashing. After uploading my app to the store, I uploaded the symbols to Appcenter.ms, the following are the Stack traces. I could not figure out which part of my code is responsible for this bug. I am really concerned about this. Please tell me a way to fix this. I am losing my valuable users day by day.

System.Exception: Layout cycle detected. Layout could not complete. Layout cycle detected. Layout could not complete.
ComCallHelpers.Call ($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex)
C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Packages\appcompile-20200417-081525-10484\AC\Temp\Ilc882687807\StudyAndPractice.McgInterop\SharedStubs.g.cs at 3376, line 5

System.Runtime.InteropServices
McgMarshal.ThrowOnExternalCallFailed (Int32 hr, RuntimeTypeHandle typeHnd) f:\dd\ndp\fxcore\CoreRT\src\System.Private.Interop\src\Shared\McgMarshal.cs at 1267:13
__Interop
ComCallHelpers.Call ($__ComObject __this, RuntimeTypeHandle __typeHnd, Int32 __targetIndex) C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Packages\appcompile-20200417-081525-10484\AC\Temp\Ilc882687807\StudyAndPractice.McgInterop\SharedStubs.g.cs at 3376:5
__Interop.ForwardComStubs
Stub_11<System.__Canon> (Void* InstParam, $__ComObject __this, Int32 __targetIndex) C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Packages\appcompile-20200417-081525-10484\AC\Temp\Ilc882687807\StudyAndPractice.McgInterop\SharedStubs.g.cs at 417:4
Microsoft.AppCenter.Utils
ApplicationLifecycleHelper.<ctor>b__17_1 (Object sender, $UnhandledErrorDetectedEventArgs eventArgs) at 0

Most affected OS
10.0.18362 38.7%
10.0.18363 35.5%
10.0.17763 25.8%

Note: I don't get my app crashed in my 3 systems. so I am unable to guess which part causes this error!

windows-uwpwindows-uwp-xaml
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

>I don't get my app crashed in my 3 systems.

Are you testing in release mode? Or you run the app in the debug mode? It might be better to test it in release mode since the issue happens when it is downloaded from the store.

It's hard to locate where the issue is. Could you please check if you will add many UIElement to the layout in your app without calling UpdateLayout() method? Or there is a control call itself that leads a loop? These are some common scenarios that might cause Layout Cycle detected exception.


0 Votes 0 ·

0 Answers