Search Issue Tracker

By Design

Unknown (hidden) 2019.4.X, 2020.3.X, 2021.2.X, 2022.1.X, 2022.2.X

Votes

0

Found in

2019.4.36f1

2020.3.31f1

2021.2.14f1

2022.1.0b11

2022.2.0a7

2022.2.0a14

Issue ID

UUM-3431

Regression

No

"EndLayoutGroup: BeginLayoutGroup must be called first." error is thrown when using AssetDatabase.ExportPackage in EditorWindow

--

-

How to reproduce:
1. Open the user's attached "ExportPackage" project
2. Open the "Package Exporter -> Exporter Window" window from the menu
3. Select the "Export package" button

Expected result: The "Exporting package" window is invoked
Actual result: "EndLayoutGroup: BeginLayoutGroup must be called first." error is thrown in the Console log

Reproducible with: 2019.4.36f1, 2020.3.31f1, 2021.2.14f1, 2022.1.0b11, 2022.2.0a7, 2022.2.0a14

  1. Resolution Note:

    This problem occurs because of how IMGUI is designed. It doesn't support re-entrancy, meaning that you can't open a modal IMGUI during another window's OnGUI().

    There is a very easy workaround though which consists in adding a call to GUIUtility.ExitGUI() right after the call that triggers re-entrancy (so in this case right after the call to AssetDatabase.ExportPackage().

    https://docs.unity3d.com/ScriptReference/GUIUtility.ExitGUI.html

  2. Resolution Note (2019.4.X):

    2019.4 LTS has reached end-of-life. This port is cancelled.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.