Bug – Stopping the “Struggling to Update Layout” spam errors in Android Logcat?
I recently updated to 2023.1.7f which has fixed the touchscreen keyboard errors (as far as I can tell so far) but I notice when I do a development build to Android I cannot get anything useful out of it as my Android Logcat window gets spammed with the commonly discussed “Layout update is struggling to process current layout (consider simplifying to avoid recursive layout)” UI Toolkit errors.
Previously we used to get spammed with these sometimes randomly in Editor, but I notice that has stopped in Editor for a long time now unless I have made an obvious recursive resizing coding error. I haven’t seen one of these spam errors in Editor in months that I recall. Even when playing my project on 2023.1.7f in Editor there are none on this exact project.
But when I build this same project as a development build to Android it will obviously run more slowly (as should be expected). As it is a complex project, it will struggle to hit its frame rate while debugging (also as expected). This never caused problems in Logcat as it didn’t seem to mind before on previous Unity versions. But now I am getting these endless spam errors every frame which makes it impossible for me to see any real errors or figure out any other behaviors.
Is there any way to suppress these errors or could you consider introducing one? What specifically triggers them? Is it a certain timer length that is applied to the Layout solution? Is it not finishing the Layout solution before the next frame is expected?
If it is a matter of frame length, perhaps I can “solve” it by setting a lower frame rate while doing development builds. But this is not otherwise necessary as an extra step and I would rather just suppress the error.
Any thoughts are appreciated.
Read more here: Source link