firebase-unity-sdk: [Bug] Exception: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_5_0'.

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2022.3.10f1
  • Firebase Unity SDK version: 11.5.0
  • Source you installed the SDK: .unitypackage (.unitypackage or Unity Package Manager)
  • Problematic Firebase Component: Analytics (Auth, Database, etc.)
  • Other Firebase Components in use: None (Auth, Database, etc.)
  • Additional SDKs you are using: mapbox, ARCore (Facebook, AdMob, etc.)
  • Platform you are using the Unity editor on: Windows (Mac, Windows, or Linux)
  • Platform you are targeting: Android (iOS, Android, and/or desktop)
  • Scripting Runtime: IL2CPP (Mono, and/or IL2CPP)
  • Pre-built SDK from the website or open-source from this repo: _____

[REQUIRED] Please describe the issue here:

I am trying to add the firebase analytics sdk to my unity project. It works fine in editor but when I try to launch the app on Android I get the following error:

Exception: DllNotFoundException: Unable to load DLL ‘FirebaseCppApp-11_5_0’. Tried the load the following dynamic libraries: Unable to load dynamic library ‘FirebaseCppApp-11_5_0’ because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library “FirebaseCppApp-11_5_0” not found

Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil (Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate applicationDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate arithmeticDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate divideByZeroDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate indexOutOfRangeDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate invalidCastDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate invalidOperationDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate ioDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate nullReferenceDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate outOfMemoryDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate overflowDelegate, Firebase.AppUtilPINVOKE+SWIGExceptionHelper+ExceptionDelegate systemExceptionDelegate) (at <00000000000000000000000000000000>:0) Firebase.AppUtilPINVOKE+SWIGExceptionHelper…cctor () (at <00000000000000000000000000000000>:0) Firebase.AppUtilPINVOKE…cctor () (at <00000000000000000000000000000000>:0) Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) (at <00000000000000000000000000000000>:0) Firebase.LogUtil…ctor () (at <00000000000000000000000000000000>:0) Firebase.LogUtil…cctor () (at <00000000000000000000000000000000>:0) Firebase.FirebaseApp…cctor () (at <00000000000000000000000000000000>:0) FirebaseManager.Initialize () (at <00000000000000000000000000000000>:0) Main.Start () (at <00000000000000000000000000000000>:0) Rethrow as TypeInitializationException: The type initializer for ‘Firebase.AppUtilPINVOKE.SWIGExceptionHelper’ threw an exception. Firebase.AppUtilPINVOKE…cctor () (at <00000000000000000000000000000000>:0) Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) (at <00000000000000000000000000000000>:0) Firebase.LogUtil…ctor () (at <00000000000000000000000000000000>:0) Firebase.LogUtil…cctor () (at <00000000000000000000000000000000>:0) Firebase.FirebaseApp…cctor () (at <00000000000000000000000000000000>:0) FirebaseManager.Initialize () (at <00000000000000000000000000000000>:0) Main.Start () (at <00000000000000000000000000000000>:0) Rethrow as TypeInitializationException: The type initializer for ‘Firebase.AppUtilPINVOKE’ threw an exception. Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) (at <00000000000000000000000000000000>:0) Firebase.LogUtil…ctor () (at <00000000000000000000000000000000>:0) Firebase.LogUtil…cctor () (at <00000000000000000000000000000000>:0) Firebase.FirebaseApp…cctor () (at <00000000000000000000000000000000>:0) FirebaseManager.Initialize () (at <00000000000000000000000000000000>:0) Main.Start () (at <00000000000000000000000000000000>:0)

I’ve tried several different suggestions I’ve found on Google like installing the standalone package vs. the package from the tutorials. I’ve tried both .NET Framework and .NET 2.1 as the API Compatibility Level. I’ve also run External Dependency Manager’s Force resolve several times, and tried both Unity versions 2022.3.10f1 and 2022.1.23f1. Any help resolving this issue would be most appreciated! Would downgrading to a previous version of analytics potentially work?

Steps to reproduce:

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? What’s the issue repro rate? (eg 100%, 1/5 etc) 100%

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you’re reporting, you will likely receive a faster response on your issue.

Relevant Code:

// TODO(you): code here to reproduce the problem

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

If anyone is still stuck, I resolved this issue by resolving the android deps.

Assets > External Dependency Manager > Android Resolver > Force Resolve

There was a bit of leg work to make that work, but it was possible to trace from that point.

image