firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

[Bug] DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_4_0'

Open johntitor08 opened this issue 2 years ago • 13 comments

[REQUIRED] Please fill in the following fields:

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

[REQUIRED] Please describe the issue here:

(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

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)

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

Error: DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_4_0'. Tried the load the following dynamic libraries: Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE.SWIGExceptionHelper' threw an exception. Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception. Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception. Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.

johntitor08 avatar Sep 04 '23 21:09 johntitor08

This is a common issue with project configuration. What platform are you running on that is getting this error? Are all the Firebase SDKs that you are using the version at 11.4.0?

a-maurice avatar Sep 05 '23 21:09 a-maurice

@johntitor08 I had this error for ANDROID and I fix it (I haven't tested it for iOS jet) DllNotFoundException: FirebaseCppApp-11_2_0 assembly: It was actually very simple for me.

  1. The Firebase and ExternalDependencyManager folders must be located in the Asset folder; you should not move them elsewhere.

  2. Delete the Firebase and ExternalDependencyManager folders and then install each Firebase SDK asset you need.

  3. Run Force resolve. Screenshot_84

Antonio-Gorisek avatar Sep 09 '23 01:09 Antonio-Gorisek

Have same error even on firebase database test project (https://github.com/firebase/quickstart-unity/tree/master/database/testapp)

@Antonio-Gorisek not worked for me

Unity editor version: 2022.3.8f1 Firebase Unity SDK version: 11.4.0 Source you installed the SDK: FirebaseDatabase.unitypackage Problematic Firebase Component: Database Other Firebase Components in use: none Additional SDKs you are using: none Platform you are using the Unity editor on: Windows Platform you are targeting: Android Scripting Runtime: tried both Mono and IL2CPP

Error: DllNotFoundException: FirebaseCppApp-11_4_0 assembly: type: member:(null) Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:4087) Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. Firebase.AppUtilPINVOKE..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:4107) Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception. Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:4817) Firebase.LogUtil..ctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:81) Firebase.LogUtil..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:37) Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception. Firebase.FirebaseApp..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:2014) Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception. Firebase.Sample.Database.UIHandler.Start () (at Assets/Firebase/Sample/Database/UIHandler.cs:53)

kosars avatar Sep 13 '23 10:09 kosars

Hey @johntitor08. 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 avatar Sep 20 '23 01:09 google-oss-bot

This is a common issue with project configuration. What platform are you running on that is getting this error? Are all the Firebase SDKs that you are using the version at 11.4.0?

webgl

johntitor08 avatar Sep 20 '23 16:09 johntitor08

Absolutely same here! Tried all found solutions. Reinstall SDK, Force Resolve, reinstall C++ redist nothing helps. This happens for me in editor with first request on any method from Firebase library from code in runtime.

Unity editor version: 2022.3.8f1 Firebase Unity SDK version: 11.4.0 Source you installed the SDK: FirebaseAnalytics.unitypackage, FirebaseCrashlytics.unitypackage, FirebaseRemoteConfig.unitypackage, FirebaseMessaging.unitypackage Platform you are using the Unity editor on: Windows Platform you are targeting: Android

DllNotFoundException: FirebaseCppApp-11_4_0 assembly: type: member:(null) Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:4087) Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. Firebase.AppUtilPINVOKE..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:4107) Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception. Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/macos_unity/x86_64/app/swig/Firebase.App_fixed.cs:4817) Firebase.LogUtil..ctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:81) Firebase.LogUtil..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:37) Rethrow as TypeInitializationException: The type initializer for 'Firebase.LogUtil' threw an exception. Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception. Firebase.Crashlytics.Crashlytics+PlatformAccessor..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/crashlytics/src/Crashlytics.cs:143) Rethrow as TypeInitializationException: The type initializer for 'PlatformAccessor' threw an exception. Firebase.Crashlytics.Crashlytics.set_IsCrashlyticsCollectionEnabled (System.Boolean value) (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/crashlytics/src/Crashlytics.cs:52) Enixan.Engine.Adapters.FirebaseCrashlyticsAdapter..ctor (Zenject.SignalBus signalBus, Enixan.Engine.Configs.IMainConfig mainConfig, Enixan.Engine.Adapters.FirebaseConnector firebaseConnector) (at Assets/EnixanEngineSubmodule/Scripts/Runtime/Adapters/Firebase/FirebaseCrashlyticsAdapter.cs:25)

Visual Studio do not see any problems with dll. All code is obtainable and higlighted.

image

On screenshot there is a line that causes DLL exception.

Help please. It happen only for me, all other teammates continue working good. Possible thing is that it started when i updated from VS 2019 to VS 2022. And installed Visual C++ redist 22. I'll check later and share the result

Andrii-Perevoznyi avatar Sep 26 '23 12:09 Andrii-Perevoznyi

Unfortunately no success with my experiments. Only one explanation i have now that my Windows version after update became to be incompatible with some of .Net things =( image image

x64

This issue appears even with empty SampleProject with: Unity 2022.3.8f1, Windows 10 enterprise LTSC (1809), Intel Core i5-6500 @ 3,2Ghz

Steps:

  1. Launch Sample 2D project in Unity 2022.3.8
  2. Add FirebaseCrashlitycs.unitypackage 11.4.0
  3. Add Simple MonoBehaviour to mainCamera on SampleScene with folowing code:
public class Script : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        Firebase.Crashlytics.IsCrashlyticsCollectionEnabled = false;
    }

}
  1. Start play mode and see results.

Andrii-Perevoznyi avatar Sep 26 '23 14:09 Andrii-Perevoznyi

yeah... i gave up to get webgl build and publish as downloadable


Gönderen: Andrii-Perevoznyi @.> Gönderildi: 26 Eylül 2023 Salı 17:14 Kime: firebase/firebase-unity-sdk @.> Bilgi: John Titor @.>; Mention @.> Konu: Re: [firebase/firebase-unity-sdk] [Bug] DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_4_0' (Issue #856)

Unfortunately no success with my experiments. Only one option i have now that my Windows version after update becames to be incompatible with some of .Net things =(

— Reply to this email directly, view it on GitHubhttps://github.com/firebase/firebase-unity-sdk/issues/856#issuecomment-1735630855, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AWW2T6C2VFVIPYMFYI4TO63X4LPMNANCNFSM6AAAAAA4K3Y2UM. You are receiving this because you were mentioned.Message ID: @.***>

johntitor08 avatar Sep 27 '23 01:09 johntitor08

No need to make webgl build. Just wanted to make it alive in editor with Android target platform

On Wed, 27 Sept 2023, 03:06 John Titor, @.***> wrote:

yeah... i gave up to get webgl build and publish as downloadable


Gönderen: Andrii-Perevoznyi @.> Gönderildi: 26 Eylül 2023 Salı 17:14 Kime: firebase/firebase-unity-sdk @.> Bilgi: John Titor @.>; Mention @.> Konu: Re: [firebase/firebase-unity-sdk] [Bug] DllNotFoundException: Unable to load DLL 'FirebaseCppApp-11_4_0' (Issue #856)

Unfortunately no success with my experiments. Only one option i have now that my Windows version after update becames to be incompatible with some of .Net things =(

— Reply to this email directly, view it on GitHub< https://github.com/firebase/firebase-unity-sdk/issues/856#issuecomment-1735630855>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AWW2T6C2VFVIPYMFYI4TO63X4LPMNANCNFSM6AAAAAA4K3Y2UM>.

You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-unity-sdk/issues/856#issuecomment-1736510128, or unsubscribe https://github.com/notifications/unsubscribe-auth/BC2TITP5MERFVV57LSEXOBDX4N3ZBANCNFSM6AAAAAA4K3Y2UM . You are receiving this because you commented.Message ID: @.***>

Andrii-Perevoznyi avatar Sep 27 '23 04:09 Andrii-Perevoznyi

Tried on my laptop. Works perfectly. Only differences are Windows 10 Home 22H2 Processor Intel Core i7-4710HQ, 2,5GHz x64

Andrii-Perevoznyi avatar Sep 27 '23 08:09 Andrii-Perevoznyi

I don't know if anyone is still facing the same issue in the editor, but after numerous attempts, I managed to solve it by simply disabling my antivirus.

After disabling my antivirus, Firebase worked fine. I then reactivated my antivirus and created a random project in Unity. I imported the FirebaseAppCheck SDK into it, added a script that called FirebaseApp.CheckAndFixDependenciesAsync, and dragged it into the scene to play.

After completing these steps in the random project, I closed it and reopened the actual project where I was encountering the same issue.

Surprisingly, when I returned to the actual project, it was playing nicely without encountering the error anymore.

I can't guarantee that only disabling the antivirus, playing Unity Editor, and enabling it back will already solve it, but you can follow the same steps I've done

lourenco-pedro avatar Dec 12 '23 15:12 lourenco-pedro

Tried on my laptop. Works perfectly. Only differences are Windows 10 Home 22H2 Processor Intel Core i7-4710HQ, 2,5GHz x64

Me too, my laptop met same error. But my team don't. I use Windows 10 core i3-4005U, 1696MHz, x64

Nghidang14 avatar May 08 '24 08:05 Nghidang14

@Nghidang14 Try this. https://github.com/firebase/firebase-unity-sdk/issues/443#issuecomment-1231976123

In my case. it solved by installation of 'c++ redistributable 2022'.

ogix-mimura avatar May 20 '24 05:05 ogix-mimura

Hey folks, it looks like everybody might have similar problems with different resolutions. Please file a new issue with your concern so that we can cater to each developer's specific issue. That said, it does look like the issue has been resolved with the proposed fixes, so I'll go ahead and close this thread.

argzdev avatar May 31 '24 10:05 argzdev