Fatal Error In Packaged Project With TMS Overlay

Dear Kevin and community,

I’m packaging an Unreal Engine 5.4 project with the Cesium plugin and running an nginx proxy to serve TMS tiles via a configured tilemapresource.xml. In both Editor and Standalone Play, the Cesium Sun/Sky, BingOverlay+Terrain 3D Tileset and CesiumTileMapServiceRasterOverlay all load correctly.

However, when I build as Dev or Shipping, the game crashes with a “Fatal Error” window exactly when the TMS overlay tries to load (the Bing overlay has already appeared; see screenshot).

Since the same setup works in-editor, I suspect either the CesiumTileMapServiceRasterOverlay or my tile‐serving setup is at fault. Has anyone seen this issue or can suggest a fix?

Thank you for your help and insights.

Hi @Kevin_Ring and @janine ,

We fixed the fatal error by reverting the Cesium plugin’s tinyxml2.lib to its original build. As you know, the tinyxml2.lib mismatch between nDisplay and Cesium is a well-documented issue. We’d swapped in nDisplay’s library so another project with nDisplay would compile, but that broke the CesiumTileMapServiceRasterOverlay: The project compiles but shows the “Fatal error!” on start. Cesium clearly depends on its own build. We’re now working on merging/patching tinyxml2 to support both plugins. Any suggestions or known solutions?

Hi!

I’m a collegue of @VI-JH with more focus on the C++ side. I could fix it for us and wanted to share my solution here.

My first idea was to do a custom Unreal Engine 5.4 build from Epic’s GitHub repository and fix the dependencies of nDisplay’s MCPDI library to a rather old version of tinyxml2. I guess this would be the most beatiful but also very time consuming solution.
Thats why I decided to go a rather simple way, which might not work, but fortunately with a little bit luck it did work for us as a dirty fix :slight_smile:

Short Explanation:
I downloaded tinyxml2 (tag: 9.0.0) and made a small change to the code. I simply added the old required constructor of XMLPrinter with two parameters and was hoping the ABI is still correct. Here is my diff:

diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index 31925d9..c6396de 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -2571,6 +2571,9 @@ XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :
     _buffer.Push( 0 );
 }
 
+XMLPrinter::XMLPrinter( FILE* file, bool compact )
+: XMLPrinter( file, compact, 0 )
+{}
 
 void XMLPrinter::Print( const char* format, ... )
 {
diff --git a/tinyxml2.h b/tinyxml2.h
index 452ae95..10f459d 100755
--- a/tinyxml2.h
+++ b/tinyxml2.h
@@ -2243,7 +2243,8 @@ public:
     	If 'compact' is set to true, then output is created
     	with only required whitespace and newlines.
     */
-    XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );
+    XMLPrinter( FILE* file, bool compact, int depth );
+    XMLPrinter( FILE* file=0, bool compact = false );
     virtual ~XMLPrinter()	{}
 
     /** If streaming, write the BOM and declaration. */

Note that I also had to change the existing constructor to not have default parameter values.

Thats all I changed. Compiled it and copied (overwrite) the used tinyxml.lib files from nDisplay AND Cesium.

nDisplay’s tinyxml2.lib: C:\Program Files\Epic Games\UE_5.4\Engine\Plugins\Runtime\nDisplay\Source\ThirdParty\MPCDI\Lib

Cesium’s tinyxml2.lib: C:\Program Files\Epic Games\UE_5.4\Engine\Plugins\Marketplace\CesiumForUnreal_5.4\Source\ThirdParty\lib\Windows-AMD64-Release

How I built tinyxml2 on Windows

  • git clone https://github.com/leethomason/tinyxml2.git
  • git checkout 9.0.0
  • Open vs/tinyxml2.sln with Visual Studio 2022
  • In the Solution Explorer
    • Expand tinyxml2Source Files and right click on xmltext.cppRemove
    • Right click on project tinyxml2Properties
    • Navigate to General and set “Configuration Type” to “Static Library (.lib)”
    • Click OK
    • Apply above mentioned changes to source.
    • Right click on project tinyxml2Build (make sure to select “Release” built in toolbar before starting)

Now you should find your tinyxml2.lib in $SRC/vs/x64/Release or folder.

Compiler Version: I used v143 (14.38.33130); Location: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130

Thats It.

In case you want to give it a quick try, I uploaded my tinyxml2.lib to my drive: https://drive.google.com/file/d/1rKMqOYUIdc_Rz69MzQ0bFDfnskcGV05B/view?usp=sharing

Best
Manuel

PS: I’m aware that there is no gurantee that this will work forever or is considered “safe”, but it works for now.

Updated (13.05.25): I wrote Unreal Version 5.5 but we are currently bound to 5.4.

1 Like

Hi @Manuel_Freiholz, welcome to the community! And thanks for sharing your solution.

Unfortunately, those are exactly the kinds of dirty tricks we sometimes have to resort to for third-party dependencies in Unreal’s “dump every plugin into one executable” compilation model. Well done getting something that works!

In theory, in UE 5.5, it should be possible to compile cesium-native against UE’s version of tinyxml2. We have an issue for this, but haven’t tried it yet:

Even though cesium-native can’t use Unreal’s tinyxml2 successfully when we just hard-swap it in, I think that if we actually compile against the corresponding headers then everything will work correctly. We won’t know for sure until we try it, though.

2 Likes