Reproduction steps:
1. Ensure the Editor has the Android Support module
2. Download and unzip the “WorkerFreeze_Stripped“ project
3. Ensure the project has no Library
4. Run the following command in Terminal: PATH_TO_UNITY -batchmode -quit -projectPath PATH_TO_PROJECT -executeMethod PackageExporter.ExportProject -nographics
5. Observe the logs in the Terminal
Expected result: The batchmode is exited successfully
Actual result: The Editor is stuck indefinitely at “Starting new worker” or “Worker ready: AssetImportWorker”
Regressed in: 2021.3.23f1
Already fixed in: 2022.3.5f1, 2023.2.0a22
Reproduced in: 2021.3.23f1, 2021.3.29f1, 2022.3.4f1, 2023.1.6f1, 2023.1.7f1, 2023.2.0a21
Not reproduced in: 2021.3.22f1, 2022.3.5f1, 2022.3.6f1, 2023.2.0a22, 2023.2.0b3
Reproduced using: macOS 13.4.1 (c) (Intel)
The last few logs:
Starting new worker id: 0 with log in
Starting new worker id: 1 with log in
Worker ready: AssetImportWorker1 1
Worker ready: AssetImportWorker0 0
Based on AssetImportWorker logs, the workers get stuck at:
Android Extension - Scanning For ADB Devices 390 ms
Attempted to call .Dispose on an already disposed CancellationTokenSource
Android Extension - Scanning For ADB Devices 408 ms
Example command: /Applications/Unity/2021.3.23f1_213b516bf396_x64/Unity.app/Contents/MacOS/Unity -batchmode -quit -projectPath /Users/ainis/Downloads/WorkerFreeze_Stripped -executeMethod PackageExporter.ExportProject -nographics
Note: Similar to https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-41796 which was fixed in 2023.2.0a21