Hi I’m switching from CesiumForUnreal version 2.1.0 to version 2.7.1, and I am encountering a fatal error in packaged executable. In my current user workflow, I have a custom C++ actor that spawns a Cesium3DTileset during BeginPlay() and then sets the ion access token at runtime via C++. When I switched to version 2.7.1 , I started seeing a fatal crash in packaged game that happens at the below line in Cesium3DTileset. I do not use a default access token in my project and my token value is set at runtime right after the call to spawning the Cesium3DTileset actor. I would like to know if I need to update my code related to spawning tileset in 2.7.1 version update.
Update:
It appears that based on the change logs of version 2.2.0, the CesiumIonServer uses the CesiumIonSaas data asset that is not getting packaged in my game because I spawn the tileset at runtime via C++ and there are no references to CesiumIonSaas data asset in my project. After forcing that data asset to be packaged in the game, the fatal error disappears. Is this the right solution for this problem? Can I avoid the fatal error coming from accessing uninitialized FString (this->CesiumIonServer->DefaultIonAccessToken) without packaging that data asset?
I don’t think there’s any other solution short of changes to the Cesium for Unreal soure code. Even if we added a null check there, there are likely other places that will assume a valid CesiumIonServer, and in the end we need a valid ion API end point URL in order to load an asset from there. So perhaps the plugin should force CesiumIonServer instances to always be included in built games, so you don’t have to do that manually?
Thanks for confirming! Yes it would be great if all dependencies like that could either be automatically forced to be built in games or at the least throw an error suggesting which dependency is missing in game rather than an access violation error.
I noticed that UCesiumIonServer::GetDefaultServer() can create the data asset required while using the editor, but in my case since our workflow is to spawn a tileset in built game at runtime, this gives nullptr. So there’s no good way for my packaging script to automatically find this dependency and package it for use in built game.