question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FR] Support Unity Server Builds

See original GitHub issue

Our mobile project has a multiplayer server which will run on linux. We build the server with Target Platform set to linux and Server Build ticked on the Build Settings window in Unity Editor on Windows.

When the server starts the attached log message is seen. server_crash.txt This part at the end hints that the libs aren’t loaded:

Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/FirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/FirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/FirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/FirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/FirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0.so
Fallback handler could not load library /local/game/server_Data/Mono/libFirebaseCppApp-8_9_0
Could not resolve all Firebase dependencies System.TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: FirebaseCppApp-8_9_0
  at (wrapper managed-to-native) Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil(Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
  at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x000ee] in <5832818f1ad84593aa2717f5b3d23851>:0
   --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <5832818f1ad84593aa2717f5b3d23851>:0
   --- End of inner exception stack trace ---
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <5832818f1ad84593aa2717f5b3d23851>:0
  at Firebase.LogUtil..ctor () [0x0001e] in <5832818f1ad84593aa2717f5b3d23851>:0
  at Firebase.LogUtil..cctor () [0x00010] in <5832818f1ad84593aa2717f5b3d23851>:0
   --- End of inner exception stack trace ---
  at Firebase.FirebaseApp..cctor () [0x0004a] in <5832818f1ad84593aa2717f5b3d23851>:0
   --- End of inner exception stack trace ---
  at Framework.Core.Managers.FirebaseInstaller+<Initialize>d__6.MoveNext () [0x0001e] in <98c85913016548029f68f9361c660fef>:0
Waiting for managers.
Uploading Crash Report
DllNotFoundException: FirebaseCppApp-8_9_0
  at (wrapper managed-to-native) Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil(Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
  at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x000ee] in <5832818f1ad84593aa2717f5b3d23851>:0
Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <5832818f1ad84593aa2717f5b3d23851>:0
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception.
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <5832818f1ad84593aa2717f5b3d23851>:0
  at Firebase.LogUtil..ctor () [0x0001e] in <5832818f1ad84593aa2717f5b3d23851>:0
  at Firebase.LogUtil..cctor () [0x00010] in <5832818f1ad84593aa2717f5b3d23851>:0
Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception.
  at Firebase.FirebaseApp..cctor () [0x0004a] in <5832818f1ad84593aa2717f5b3d23851>:0
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
  at Framework.Core.Managers.FirebaseInstaller+<Initialize>d__6.MoveNext () [0x000d2] in <98c85913016548029f68f9361c660fef>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <695d1cc93cca45069c528c15c9fdd749>:0
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
  at UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () [0x00002] in <a3bf785675754762a66d8639375071d6>:0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.WorkRequest:Invoke()
UnityEngine.UnitySynchronizationContext:Exec()
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

Details:

  • Firebase .so files are in the build
  • using .NET 4.x and unity 2020.3.31f1
  • the server fails and crashes with this when built with mono or il2cpp backend
  • this happens on AWS GameLift instances - https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/ (only info I found)
  • this doesn’t happen on Ubuntu 20.04.3 LTS (our test server), runs as expected
  • this doesn’t happen when we build for Windows platform, runs as expected.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:7
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
DellaBittacommented, Jan 4, 2023

Ok, I’m going to rework this ticket as a feature request for server builds, and keep the ticket open so we can prioritize it properly.

Please upvote this issue if you’re looking to use server builds with our SDK. Thanks!

2reactions
DellaBittacommented, Nov 11, 2022

Hi all,

Just for clarity the Firebase Unity SDK doesn’t officially support server builds. We don’t build and test this scenario either, so we don’t have a full working knowledge of the trails you’re blazing. Please upvote this issue so that we can prioritize it on our roadmap.

The more information that you can provide to use the better as maybe something will jump out at us as something that we’ve encountered in other tested scenarios.

Unless I’m wrong this seems to be a missing dependency issue attempting to resolve libraries on various flavors of Linux. Potentially the Amazon versions of libsecret are incompatible with the ones that the Firebase SDK requires, and though the Firebase .so files are found they can’t be loaded in conjunction with the platform’s libraries.

We mainly test against Ubuntu and I believe that Amazon Linux is either CentOS or Fedora, depending on which version of Amazon Linux you’re using. There could be a mismatch there?

@gabetoth-alder, in your latest attempt was there any output beyond Unable to preload the following plugins:? Is there more debug information that can be enabled?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unity Build Server
An on-premises licensing solution for offloading Unity project builds to network hardware.
Read more >
Manual: Build your application for Dedicated Server
To create a Dedicated Server build through the Unity Editor: From the Unity Editor, select File > Build Settings. Select Dedicated Server. Add...
Read more >
Untitled
Unity linux dedicated server build support ... on Linux with Docker - YouTube [FR] Support Unity Server Builds · Issue #232 · firebase/firebase-unity...
Read more >
Unity server build (headless) native texture pointer returns 0
When I run the following code inside a Unity Editor, or if I build and run it (not in headless mode) GetNativeTexturePtr() returns...
Read more >
How to develop both a client and headless server together ...
Myself, I'd recommend keeping the server and client authored in a single Unity project. This minimizes the chance for mistakes where you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found