Development Build error: Ensure condition failed: oldValue == newValue. ThreadingBase.cpp Line: 311

This problem just started happening to me as well, though I’ve been using 5.3 for several months and packaged dozens of builds. I think it might be related to calling “set skeletal mesh asset” but I’m not certain, it seems to most frequently happen when i play changes their appearance in my game. Its incredibly frustraing.

Hey guys, I was running into the same error when trying to launch a packaged game built in 5.3.2. When I would launch the game my screen would go black then the game would close, no crash or any thing like that. In the log it had the same error you guys have been posting. Sometimes when I repackaged it would work and other times it wouldn’t.

Someone mentioned earlier in this post about the “Share Material Shader Code” setting in the project settings and I found if i enabled it and packaged again this problem has seamed to stop, I’ve repackaged a bunch of times and the issue hasn’t returned, just wanted to share this in case anyone else ran into this problem as this might help.

5 Likes

interesting, thanks for sharing! Not sure if this is related but I have been getting some crashes → softlocks from the WorldGridMaterial shader not compiling and thus not allowing my project to open anymore.

In general I have not run into this issue since I posted the thread, although I only did shipping builds… anyway hope this gets fixed in 5.4

Deleting Binaries, Intermediate, DerivedDataCache, and saved isn’t enough. Deleting your config files isn’t enough. An entirely new project with migrated content, or compiling the project with a source build are neither good enough either.

This is the worst error I’ve encountered in my 10 years of using Unreal.

The hardest hitting, most annoying solutions don’t fix this. Must be related to a specific asset. Hard to try and find it.

EDIT: I once saw the log complain about shaders. So I disabled Shared Material Shader Code and Shared Material Native Libraries then I got this error the OP has.

I have now re-enabled them and magically I got a different log error about Steamp API 64 and noticed it was the Advanced Sessions plugin from VRExpansion causing the crash on startup. I ended up being able to use the original project and didn’t have to make a new one or anything. This is a weird and odd error, hope its the same for you all, but it seems it could be anything.

1 Like

Had to take a break from working on my game, and finally have come back to this.
Some combination of toggling the Shared Material Shader Code setting off/on/off/on has fixed my build so far. I haven’t encountered this error since; however, I know for a fact that I had tried both settings in the past, and the error persisted. After revisiting the setting, it now seems to be gone. I have no actual effing idea what is going on with it but I’m just happy I’m one of the lucky ones so far.

4 Likes

Happens here as well with 5.3.2 . So far, the only fix is to switch back to DirectX 11. Hope this will be fixed in 5.4.

Try the following changes from 5.4. You may have to cherry-pick as not all files exist in 5.3.2

https://github.com/EpicGames/UnrealEngine/commit/e704efdd1cdfecea74c711225ecd38eff5b222c7

https://github.com/EpicGames/UnrealEngine/commit/e78ba171fc8d2764c4ce18220b5777328010df30

https://github.com/EpicGames/UnrealEngine/commit/7d7c0de8abf0411489829fe86fa902d9ae040752

The related issue seems to be here: Unreal Engine Issues and Bug Tracker (UE-194642)

3 Likes

In the 5.3.2 Launcher Version, I was able to fix it with the following packaging settings:

[/Script/UnrealEd.ProjectPackagingSettings]
bShareMaterialShaderCode=True
bDeterministicShaderCodeOrder=True
bSharedMaterialNativeLibraries=True

4 Likes

This was it! Also I did launch the engine with a brand new Cpp Third Person Template to get the defaults of the engine and found that:

[/Script/UnrealEd.ProjectPackagingSettings]
bShareMaterialShaderCode=True
bSharedMaterialNativeLibraries=True

Is the default settings, so this would explain why Unreal wants them on, however:

bDeterministicShaderCodeOrder=False

This one by default is off. I am not sure if this will make a difference, but I did want to point this out for anyone who feels like testing further. I can verify that before doing this. I would crash 15% of the time when opening and always when closing the process. When Making the changes suggested here (all 3 of them), I was able to build and did not crash once out of 30 times opening the game.

Thank you for finding this, now the Unreal team just needs to investigate why being off causes issues, but if its meant to be on by default, I shall leave on.

Hi everyone,

Thanks for posting this information. If someone is having build issues similar to the original post, please try these changes, as these links point to fixes that should address this problem.

I had a very similar issue on 5.3, but bShareMaterialShaderCode didn’t fix it for me. The problem was related to the level. I still don’t really know what the issue was, but with a new persistent level containing all the same actors and sublevels, it’s working fine now."

I get exactly this issue as well when launching for Android_ASTC.
Flipping these values unfortunately does nothing for me.

  • bShareMaterialShaderCode=True
  • bSharedMaterialNativeLibraries=True
  • bDeterministicShaderCodeOrder=True

The issue is confirmed both on my working project and on a newly created Android default template project, so it’s not limited to a specific project.

Upon launching the project in the project launcher, I noticed another error as well in the log output:

This error has also been mentioned on this forum, but I’m not sure if it is related to this issue though. It appears just as the task “Deploying content for Android” finishes, then the rest of the issues mentioned in this thread appear as I start it up on the phone.

I’ve tried reinstalling everything relevant to this, i.e. Unreal Engine, Java and so on. Currently sitting on 5.3.2, have yet to try it out on 5.4.1, but will do so as soon as possible.

If anyone has any more insight into this, I’d gladly hear from you. I’ll turn bald soon enough if I don’t solve this soon!

I got rid of this issue, but it’s unclear as to what actually solved it. The things I did: I upgraded the project to v5.4.1, reinstalled SDKs and NDKs with Turnkey and turned on the plugin AndroidFileServer.

I’m guessing it was you moving to 5.4 that solved it. Unfortunately not an option for me as I’m working in a team.
I’m running in to this problem on 5.3 of Meta’s Fork (developing on Quest).
I’ve been banging my head against the wall for days on this, must have built the engine like 10 times.
Possibly the worst problem I’ve encountered in my career so far.
Log attached.
UnrealLog-20240606-163637.txt (189.8 KB)

I tried doing this, but the engine would not compile after. Also that 3rd commit, the file does not exist in 5.3
Also tried switching the Default RHI to DX11 - did not work.

Yeah, it was most definitely the version upgrade. Which is annoying since I don’t know what the change was.

Regarding your issue, have you tried packaging the project with different packaging configs? I.e. Development, DebugGame and Shipping?

I did not think to try that. I solved it by deleting my source build of the Meta Fork (I was updated to the latest commit and going back one commit, cloning that one and building. That allowed me to get a build running in Android finally after days of this. I raised an issue on Meta’s Github, let’s see what they say.