firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
201 stars 33 forks source link

[Bug] Exception: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_5_0'. #879

Open mjs9513 opened 9 months ago

mjs9513 commented 9 months ago

[REQUIRED] Please fill in the following fields:

[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
paulinon commented 9 months ago

Hi @mjs9513,

Could you try if manually removing then reimporting the Firebase SDK makes a difference? Otherwise, does enabling Any Platform in your FirebaseCppApp-11_5_0.dll file resolve the issue?

If none of these steps worked, could you provide a minimal, reproducible example of your implementation so we can identify what's causing this to happen?

mjs9513 commented 9 months ago

Hello @paulinon,

I've tried removing Firebase before through Package Manager, but I'll give it a try again.

So far the only package that it is getting removed is Google Analytics 11.5.0 and External Dependency Manager: image

I removed them using the External Dependency Manager, then I manually removed the External Dependency folder and was not able to find anything else under the "Manual Remove" section.

I then went to https://developers.google.com/unity/archive and downloaded the External Dependency tgz, installed it, then downloaded the Firebase App Core 11.5.0 tgz and installed it as well. Then grabbed the Firebase Analytics package .tgz and installed that as well

image

The firebase stuff is now in the 'Packages' section apart from Assets, and when I try to edit the FirebaseCppApp-11_5_0.dll file currently it's in Firebase App (Core) -> Firebase -> Plugins -> x86_64, and it is greyed out.

image image

I then tried building the project with just these two packages installed after running External Dependency Manager -> Force Resolve and External Dependency Manager -> Delete Resolved Libraries.

The resulting Android build threw an error when trying to launch:

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)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception.
Firebase.FirebaseApp..cctor () (at <00000000000000000000000000000000>:0)
FirebaseManager.Initialize () (at <00000000000000000000000000000000>:0)
Main.Start () (at <00000000000000000000000000000000>:0)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
FirebaseManager.Initialize () (at <00000000000000000000000000000000>:0)
Main.Start () (at <00000000000000000000000000000000>:0)>

I saw these settings mentioned on a few forum threads, so here are the build settings I am currently using for scripting backend and all of that: image

Are there any settings that need to be added to gradleTemplate.properties or mainTemplate.grade? Those files currently look like the following for me:

gradleTemplate.properties:

org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
org.gradle.parallel=true
unityStreamingAssets=**STREAMING_ASSETS**
//Android Resolver Properties Start
android.useAndroidX=true
android.enableJetifier=true
//Android Resolver Properties End
**ADDITIONAL_PROPERTIES**

mainTemplate.gradle:

apply plugin: 'com.android.library'
**APPLY_PLUGINS**

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}

android {
    ndkPath "**NDKPATH**"

    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
    }

    lintOptions {
        abortOnError false
    }

    aaptOptions {
        noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**PACKAGING_OPTIONS**
}
**IL_CPP_BUILD_SETUP**
**SOURCE_BUILD_SETUP**
**EXTERNAL_SOURCES**
mjs9513 commented 9 months ago

I've also tried removed all three packages via the Unity Package Manager and grabbing the Unity Package for Firebase Analytics from https://developers.google.com/unity/archive#google_analytics_for_firebase and installing it through Assets -> Import Package -> Custom Package, with everything showing up as "New"

image

This atleast gave me the ability to edit the FirebaseCppApp-11_5_0.dll file as it was now in Assets -> Firebase -> Plugins -> x86_64 and I was able to swap it to "Any Platform".

image

Ran External Dependency Manager Force Resolve and Delete Resolved Libraries again.

Interestingly, when running External Dependency Manager -> Force Resolve I got this in the Console Log relating to Firebase, not sure if it's related/significant or not: image

Sadly though, after uninstalling the app completely from my android device and reinstalling it again with the newly imported, packages, I got the error again:

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 also tried selecting the Load on Startup option and got the same result.

paulinon commented 8 months ago

Hi @mjs9513,

Version 11.6.0 of the SDK has been released recently. Could you try it out and see if it makes any difference? If it doesn't, it would be helpful if you share a minimal, reproducible example so that we could use it as a basis for troubleshooting the issue.

pabloleban commented 8 months ago

Some of my users are getting the same error on Windows 10 after updating from Firebase 11.1.0 to Firebase 11.6.0

I have Windows 11, and in my case it's working correctly.

Downgrading to 11.1.0 again fixes the issue.

These are the logs from 2 different users:

[Physics::Module] Initialized MultithreadedJobDispatcher with 11 workers.
Initialize engine version: 2022.3.12f1 (4fe6e059c7ef)
[Subsystems] Discovering subsystems at path E:/SteamLibrary/steamapps/common/Idle Slayer/Idle Slayer_Data/UnitySubsystems
GfxDevice: creating device client; threaded=1; jobified=0
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: Radeon RX 580 Series (ID=0x67df)
    Vendor:   ATI
    VRAM:     8170 MB
    Driver:   30.0.15021.11005
<RI> Initializing input.

<RI> Input initialized.

D3D11 device created for Microsoft Media Foundation video decoding.
<RI> Initialized touch support.

UnloadTime: 0.389200 ms
DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_6_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-11_6_0' because of 'Failed to open the requested dynamic library (0x06000000) - Не найден указанный модуль.  (WinError:0000007e)
  at 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) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE.SWIGExceptionHelper' threw an exception.
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception.
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception.
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.Crashlytics.Crashlytics.PlatformAccessor' threw an exception.
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0
[Physics::Module] Initialized MultithreadedJobDispatcher with 5 workers.
Initialize engine version: 2022.3.12f1 (4fe6e059c7ef)
[Subsystems] Discovering subsystems at path C:/Program Files (x86)/Steam/steamapps/common/Idle Slayer/Idle Slayer_Data/UnitySubsystems
GfxDevice: creating device client; threaded=1; jobified=0
Direct3D:
    Version:  Direct3D 11.0 [level 11.1]
    Renderer: NVIDIA GeForce GTX 1070 Ti (ID=0x1b82)
    Vendor:   NVIDIA
    VRAM:     8079 MB
    Driver:   30.0.14.7212
<RI> Initializing input.

<RI> Input initialized.

<RI> Initialized touch support.

UnloadTime: 0.272498 ms
DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_6_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-11_6_0' because of 'Failed to open the requested dynamic library (0x06000000) - The specified module could not be found.  (WinError:0000007e)
  at 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) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE.SWIGExceptionHelper' threw an exception.
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception.
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception.
  at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
  at Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () [0x00000] in <00000000000000000000000000000000>:0 
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
Rethrow as TypeInitializationException: The type initializer for 'Firebase.Crashlytics.Crashlytics.PlatformAccessor' threw an exception.
  at Firebase.Crashlytics.Crashlytics.SetCustomKey (System.String key, System.String value) [0x00000] in <00000000000000000000000000000000>:0 
  at LocalizationSystem.GetLocalizedValue (System.String key) [0x00000] in <00000000000000000000000000000000>:0 
  at StartingText.Awake () [0x00000] in <00000000000000000000000000000000>:0 
google-oss-bot commented 8 months ago

Hey @mjs9513. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

robojiannis commented 8 months ago

we're experiencing the same issue

google-oss-bot commented 8 months ago

Hey @mjs9513. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 7 months ago

Hey @mjs9513. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

ekrenzin commented 7 months ago

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

google-oss-bot commented 7 months ago

Hey @mjs9513. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

mjs9513 commented 7 months ago

So, after some testing and digging around, I found out that the issue appears to be related to the Mapbox SDK. If the mapbox SDK and firebase are in the same project, it seems to cause an issue when External Dependency Manager is run. Unfortunately tho, the Mapbox SDK for Unity appears to no longer be under support and won't be getting any further updates, so I doubt it'd be successful if I reached out to them and asked them for the fix.

Here's a link to the Mapbox Unity SDK repo: https://github.com/mapbox/mapbox-unity-sdk

mjs9513 commented 7 months ago

Any updates on this? Getting the same error on iOS as well when building it with Unity Cloud Building;

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 'Firebase.AppUtilPINVOKE.SWIGExceptionHelper' threw an exception. ---> System.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(/FirebaseCppApp-11_5_0, 0x0005): tried: '/FirebaseCppApp-11_5_0' (errno=2), '/private/preboot/Cryptexes/OS/FirebaseCppApp-11_5_0' (errno=2), '/FirebaseCppApp-11_5_0' (errno=2) at 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) [0x00000] in <00000000000000000000000000000000>:0 at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 at FirebaseManager.Initialize () [0x00000] in <00000000000000000000000000000000>:0 at Main.Start () [0x00000] in <00000000000000000000000000000000>:0 --- End of inner exception stack trace --- at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 at FirebaseManager.Initialize () [0x00000] in <00000000000000000000000000000000>:0 at Main.Start () [0x00000] in <00000000000000000000000000000000>:0 --- End of inner exception stack trace --- at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00000] in <00000000000000000000000000000000>:0 at Firebase.LogUtil..ctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.LogUtil..cctor () [0x00000] in <00000000000000000000000000000000>:0 at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 at FirebaseManager.Initialize () [0x00000] in <00000000000000000000000000000000>:0 at Main.Start () [0x00000] in <00000000000000000000000000000000>:0 --- End of inner exception stack trace --- at Firebase.FirebaseApp..cctor () [0x00000] in <00000000000000000000000000000000>:0 at FirebaseManager.Initialize () [0x00000] in <00000000000000000000000000000000>:0 at Main.Start () [0x00000] in <00000000000000000000000000000000>:0 --- End of inner exception stack trace --- at FirebaseManager.Initialize () [0x00000] in <00000000000000000000000000000000>:0 at Main.Start () [0x00000] in <00000000000000000000000000000000>:0

In Assets -> Firebase -> Plugins, x86_64, and iOS folders are as follows: Assets -> Firebase -> Plugins: image iOS: image x86_64: image

mjs9513 commented 7 months ago

As a side note, I deleted the 11_6_0 content just to be sure, and ensured nothing tied to 11.6 was in the repo, and still get the error sadly. I managed to get it working on Android if EDM is never run, as that seemed to be breaking it every time like I mentioned, but when trying to build it for iOS using Unity's Cloud Build Service, it posts the error I put above.

ajitpay3 commented 6 months ago

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

Thanks @ekrenzin, this resolved my issue. I had changed my bundle id and SDK path which caused this issue.

MatsuoRotsuki commented 5 months ago

@mjs9513 i'm experiencing the same issue. How would you fix that. I just import firebase then it notified me that FirebaseCppApp-11_6_0.dll not found when builed into device, but it's working normally in editor @@

reyou commented 4 months ago

On Windows this is a little tricky problem.

Copy Android path: image

Place it under your environment settings: image

In the Unity project folder create a PowerShell file like:

C:\Users\yourUser\UnityProject\Temp\PlayServicesResolverGradle\build.ps1

Then in unity `Assets > External Dependency Manager > Android > Force Build'

This gives an error like below:

image

Then copy the command which is under "Executing command:" into the build.ps1

Once you run it, build should be succeeded:

image

If not, try updating Gradle version and try again.

image https://github.com/googlesamples/unity-jar-resolver/issues/384#issuecomment-699527697

nghiadotuan commented 4 months ago

I solved it by reinstalling windows. Windows 10 22h2 version will work fine without any modifications. Please check your windows version. If it is using an old version, for example 18xx, which is no longer supported for updates, then reinstall the latest version of Windows.

pabloleban commented 6 days ago

Most users with old versions of Windows (7 and 8) and 100% using Steamdeck are getting this issue, so I'm staying at 11.1.0 which works fine for PC builds, and I'm updating to 12.x for mobile.

I assume it has something to do with the lack of support of 32-bits systems with the latest Firebase versions.

GTaps commented 2 days ago

I have upgraded unity IAP to 4.12.0 Admob SDK 8.2.0 Firebase SDK 11.4.0

Error Unity DllNotFoundException: Unable to load DLL 'FirebaseCppApp-9_0_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-9_0_0' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-9_0_0" not found

how to fix?