Spinlock Errors on Build

I have been getting these same 3 errors when trying to integrate Cesium into my production UE project. I am able to build just fine in a new project as a test, but when I add the plugin to my existing project, even without using any Cesium functionality, the build fails with these same errors. Can anyone help? I’d be very grateful.

UATHelper: Packaging (Android (ASTC)): ld.lld: error: undefined symbol: absl::lts_20240722_cesium_for_unreal::base_internal::SpinLockWait(std::__ndk1::atomic, int, absl::lts_20240722_cesium_for_unreal::base_internal::SpinLockWaitTransition const, absl::lts_20240722_cesium_for_unreal::base_internal::SchedulingMode)
UATHelper: Packaging (Android (ASTC)): >>> referenced by call_once.h:180 (D:/.ezvcpkg/dbe35ceb30c688bf72e952ab23778e009a578f18/installed/arm64-android-unreal/include/absl/base/call_once.h:180)
UATHelper: Packaging (Android (ASTC)): >>> s2cell_id.cc.o:(void absl::lts_20240722_cesium_for_unreal::base_internal::CallOnceImpl<MaybeInit()::‘lambda’()>(std::__ndk1::atomic*, absl::lts_20240722_cesium_for_unreal::base_internal::SchedulingMode, MaybeInit()::‘lambda’()&&)) in archive J:/Unreal Projects/AppName/Plugins/Marketplace/CesiumForUnreal_5.4/Source/ThirdParty/lib/Android-aarch64-Release/libs2.a

UATHelper: Packaging (Android (ASTC)): ld.lld: error: undefined symbol: AbslInternalSpinLockWake_lts_20240722_cesium_for_unreal
UATHelper: Packaging (Android (ASTC)): >>> referenced by spinlock_wait.h:85 (D:/.ezvcpkg/dbe35ceb30c688bf72e952ab23778e009a578f18/installed/arm64-android-unreal/include/absl/base/internal/spinlock_wait.h:85)
UATHelper: Packaging (Android (ASTC)): >>> s2cell_id.cc.o:(void absl::lts_20240722_cesium_for_unreal::base_internal::CallOnceImpl<MaybeInit()::‘lambda’()>(std::__ndk1::atomic*, absl::lts_20240722_cesium_for_unreal::base_internal::SchedulingMode, MaybeInit()::‘lambda’()&&)) in archive J:/Unreal Projects/AppName/Plugins/Marketplace/CesiumForUnreal_5.4/Source/ThirdParty/lib/Android-aarch64-Release/libs2.a

UATHelper: Packaging (Android (ASTC)): clang++: error: linker command failed with exit code 1 (use -v to see invocation)
UATHelper: Packaging (Android (ASTC)): Total time in Parallel executor: 666.64 seconds

PackagingResults: Error: undefined symbol: absl::lts_20240722_cesium_for_unreal::base_internal::SpinLockWait(std::__ndk1::atomic, int, absl::lts_20240722_cesium_for_unreal::base_internal::SpinLockWaitTransition const, absl::lts_20240722_cesium_for_unreal::base_internal::SchedulingMode)
PackagingResults: Error: undefined symbol: AbslInternalSpinLockWake_lts_20240722_cesium_for_unreal
PackagingResults: Error: linker command failed with exit code 1 (use -v to see invocation)

Hi @Setaro_House,
Are you using the officially-released version of the plugin (which version?), or have you built it yourself? It looks like the plug is embedded in your project, so it’s at least worth a try to put it in your Engine plugins directory instead to see if that helps. If you’ve built Unreal Engine yourself, though, then that probably won’t work. And in fact, that could be the cause of your troubles. We build Cesium for Unreal using Android NDK r25b, as recommended by Epic. If you’re using a different version, it’s possible that the linker errors are caused by the cesium-native .a files included with the plugin being built by a different version or with different compiler settings.

Hello, thanks for your questions I hope you can help me figure this out.

I did not build the plugin or the engine myself, although I did some some rebuilding from source on the project itself. This was all weeks ago before I brought in Cesium.

I am using NDK 25.1.8937393

I have tried all combinations of:

  1. Using both the officially released version (acquired from UE Marketplace/Fab and and also the Github current release.
  2. Building with the Engine plugins folder and the Project level folder.

It always results in the same outcome.

It does build fine if I create a new project and just load in Cesium so I’m guessing that eliminates the core plugin and my NDK version correct? If so, how do I track down the issue it has with my project?

Hi just following up wto my response. The mod hid my post as spam initially so you may not have gotten the reply notification. Thanks

Please check if there’s a copy of the plugin in your project’s Plugins directory. Usually it would be in Plugins\CesiumForUnreal. If you have a copy there, plus also one installed in your Engine plugins directory (which is where Fab will put it), that can easily cause strange compilation issues. The easiest solution is to delete the one in your project and make sure that you only have the one installed from Fab. If you’ve installed the plugin manually from our GitHub releases page, it’s even possible that you have an extra copy in your Engine\Plugins\Marketplace directory.

To avoid any doubt, I suggest uninstalling and deleting all copies of Cesium for Unreal across both your project and your Unreal Engine installation. Then, reinstall it from Fab.