Search Issue Tracker
Fixed
Fixed in 6000.0.38f1, 6000.1.0b3, 7000.0.0a20
Votes
4
Found in
6000.0.36f1
6000.1.0a9
6000.2.0a1
7000.0.0a20
Issue ID
UUM-91151
Regression
Yes
GetActiveBuildProfile can only be called from the main thread crash and error when switching from Windows to Android
{}Steps to reproduce:{}{}{}
- Create a new project with URP Sample > com.unity.template.urp-sample.
- Once the project opens, open Build Profile window.
- Create a new Android Profile.
- Switch to the new Profile.
Actual results: We get a console error and unity crash after script recompile
{code:java}
UnityException: GetActiveBuildProfile can only be called from the main thread. Constructors and field initializers will be executed from the loading thread when loading a scene.{code}
Expected results: Editor does not crash or throws errors after restart.
Reproducible with versions: 6000.1.0a9
Not reproducible with versions: 6000.0.26f1, 6000.0.29f1
{}Tested on (OS):{}{}{}
- macOS (Does not repro)
- Windows
{}Notes:{}{}{}
- Reports on discussions indicate that this issues occur on the following versions: 6000.0.28 and above. However, they do not seem consistent based on my testing on those versions. The issue is consistent on trunk.
- [https://discussions.unity.com/t/unityexception-getactivebuildprofile-can-only-be-called-from-the-main-thread/1566152]
Comments (7)
-
gekidoslayer
Oct 01, 2025 17:11
This isn't fixed, still happens constantly in Unity 6.0.34f1 when you set your editor to Android / Vulkan
-
unity_B308D4B86FEC581D3307
Sep 29, 2025 13:51
I spent the entire day trying to solve this.
For me the issue seemed to have stemmed from a script using Unity.VisualScripting although there were no actual functions that needed it, at least anymore. Removing the line got rid of the error occurring.I'm a novice so I can't say this is the root issue, but checking through your packages and making sure there's no internal code that's trying to access the build profile may be the key for anyone who stumbles upon this error!
-
muhammadadnan0075
Feb 10, 2025 07:50
Have been getting it constantly since all the LTS 6000 versions
Goes away if switch from Android to Windows but switching back to android spams it back -
prukop
Jan 19, 2025 22:08
Getting this on 6000.0.33f1 on Windows after creating an Android build profile.
Seems to happen under several conditions, but very consistent when I edit and save a ShaderGraph, I get this error and stacktrace:```
UnityException: GetActiveBuildProfile can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEditor.EditorUserBuildSettings.GetActiveBuildProfile () (at <18226ebcc7724db583d19c0aeb6444e9>:0)
UnityEditor.EditorUserBuildSettings.get_activeBuildProfile () (at <18226ebcc7724db583d19c0aeb6444e9>:0)
UnityEditor.Build.Profile.BuildProfileContext.get_activeProfile () (at <18226ebcc7724db583d19c0aeb6444e9>:0)
UnityEditor.Build.Profile.BuildProfileContext.ShouldReturnActiveProfile (UnityEditor.BuildTarget buildTarget, UnityEditor.StandaloneBuildSubtarget subtarget, System.String sharedSetting) (at <18226ebcc7724db583d19c0aeb6444e9>:0)
UnityEditor.Build.Profile.BuildProfileContext.GetActiveOrClassicBuildProfile (UnityEditor.BuildTarget target, UnityEditor.StandaloneBuildSubtarget subTarget, System.String sharedSetting) (at <18226ebcc7724db583d19c0aeb6444e9>:0)
```Have tried removing/recreating the build profile, error still occurs.
-
corriedotdev
Jan 09, 2025 19:24
Replicating same issue on 6000.0.32f1 - Initially corrupted entire project. Change made before crash was adding a new video to a render texture.
-
jpq
Jan 08, 2025 16:47
error occurs on 6000.0.30f1 too
-
LePaithon
Dec 26, 2024 13:17
Getting this on 6000.0.23f1. Any time i open the unity project (android), I get spammed with this error in my console.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Unity CIL Linker fails on Player build when persistent listeners have "<" and ">" in their XML attribute names
- ”Lighting data asset ‘LightingData’ is incompatible with the current Unity version…” warnings are thrown when saving Indoors (URP) and Outdoors (URP) Scenes as Scene Templates
- [iOS] The screen blinks when transitioning from custom to Unity splash screen
- [macOS] ”Ignoring depth surface load action as it is memoryless” warnings are thrown when taking Game View Snapshot
- UI Builder Inspector scrolls back up when changes on an expanded but not fully displayed Inspector tab are saved
Resolution Note (fix version 6000.1.0b3):
Tested 4 times and did not repro with 6000.1.0b3
Resolution Note (fix version 6000.0.38f1):
Verified 6000.0.38f1, switching between windows and android URP did not crash