UnityException: GetActiveBuildProfile can only be called from the main thread

Hi. I’ve been having this error for a few days after I changed my build profile to Android. After that, I was getting mobile dependency resolver errors. After I fixed that, I’ve been having this Exception:
Screenshot 2024-12-07 172256

2 Likes

Same here on Unity 6000.0.30f1. Paired with a lot of memory leaks

Same here on Unity 6000.0.29f1

Anyone got a solution?

6000.xxx is extremely laggy and just having the editor open throws a truckload of errors and my inspector elements keep becoming blank and broken.

Errors also keep wildly changing and so far nothing that would let me pinpoint it to a source.

Reinstall did not help. Rebuilding the whole project also did not help.

Hi! This was a known issue with internal unity shaders: an assertion was triggered when switching the build target from Windows to Android. It was fixed in:

  • 6000.1.0b3
  • 6000.0.38f1

I strongly recommend upgrading to 6000.2.9f1. Upgradability should be great, and since build profile is fairly new, we’ve added many new features and fixed numerous bugs!

I’m on 6000.2.6f2 and the problem started and persisted since I updated to the 6000 generation.

Currently the editor is barely usable since inspector elements keep disappearing.

One of the many errors I get for example is:

UnityException: GetInternalActivePlatformGuid 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.GetInternalActivePlatformGuid () (at <8081513dc2364383b8289d30d2169b2e>:0)
UnityEditor.EditorUserBuildSettings.get_activePlatformGuid () (at <8081513dc2364383b8289d30d2169b2e>:0)
UnityEditor.Modules.DerivedBuildTargetExtensionsProvider.GetIBuildTarget (UnityEditor.IBuildTarget baseBuildTarget) (at <8081513dc2364383b8289d30d2169b2e>:0)
UnityEditor.Android.TargetExtension.get_PlatformBuildTarget () (at /home/bokken/build/output/unity/unity/PlatformDependent/AndroidPlayer/Editor/Managed/ExtensionModule.cs:133)
UnityEditor.BuildTargetDiscovery.GetGUIDFromBuildTarget (UnityEditor.BuildTarget buildTarget) (at <8081513dc2364383b8289d30d2169b2e>:0)
UnityEditor.Build.Profile.BuildProfileModuleUtil.GetPlatformId (UnityEditor.BuildTarget buildTarget, UnityEditor.StandaloneBuildSubtarget subtarget) (at <8081513dc2364383b8289d30d2169b2e>:0)
UnityEditor.Build.Profile.BuildProfileContext.GetActiveOrClassicBuildProfile (UnityEditor.BuildTarget target, UnityEditor.StandaloneBuildSubtarget subTarget, System.String sharedSetting) (at <8081513dc2364383b8289d30d2169b2e>:0)

This happens when I want to open a the “items” variable in the inspector in following class in the editor which is attached to the main camera:

public class MediaProvider : MonoBehaviour
{
    public Sprite[] items;
}

EDIT: Also the editor runs with about 5-10 fps (not in game, just the editor itself, like when dragging a texture to the inspector). PC is plenty strong with 5700x3d, 96gb RAM, 7900xtx.

Did you ever resolve this issue?