firebase / firebase/firebase-unity-sdk

[Bug] DllNotFoundException: FirebaseCppApp-12_6_0 assembly:<unknown assembly> type:<unknown type> member:(null)

Open
#1,258 15 comments 0 reactions 1 assignee Claimed by @milaGGL View on GitHub
api: firestore needs-attention
Dominant language
C#
Stars
320
Forks
60
Avg merge
11h 15m
Merged PRs (30d)
11

Description

### Description

I am getting the error in the title in my unity project.

This unity project pulls data from my firestore database on start. From March until maybe mid-May, everything has worked perfectly. Then suddenly, I was getting this error on my editor. This error does not come up on my colleague's machines who are working on the same repo/branch at times.

I have tried reinstalling Unity, deleting library folder and recompiling, deleting firebase modules and reimporting. Same error.

I can temporarily fix the issue by changing the settings on the dll file (FirebaseCppApp-12_6_0) in x86_64 folder. If I turn OFF 'Editor' on 'Include Platforms', somehow it starts working. This is temporary because if I close and open the project then this 'fix' does not continue working.

Colleagues on the exact same branch do not have the issue. I have not touched any firebase setting when it was originally imported. All I have done is write code to access the database and it has worked fine until now.

### Reproducing the issue

May be difficult to reproduce since this has happened suddenly and not on my colleague's machines.

Try:

- Import SDK into new project on same editor (only using Firestore package)
- do:
```
void Start()
{
// Initialize Firestore
db = FirebaseFirestore.DefaultInstance;
}
```
- See if error occurs

### Firebase Unity SDK Version

12.6.0

### Unity editor version

6000.0.33f1

### Installation Method

.unitypackage

### Problematic Firebase Component(s)

Firestore

### Other Firebase Component(s) in use

_No response_

### Additional SDKs you are using

None.

### Targeted Platform(s)

Android

### Unity editor platform

Windows

### Scripting Runtime

IL2CPP

### Release Distribution Type

Pre-built SDK from https://firebase.google.com/download/unity

### Relevant Log Output

```shell
DllNotFoundException: FirebaseCppApp-12_6_0 assembly: type: member:(null)
Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:3958)
Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
Firebase.AppUtilPINVOKE..cctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:3978)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.AppUtilPINVOKE' threw an exception.
Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:4688)
Firebase.LogUtil..ctor () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/app/src/LogUtil.cs:81)
Firebase.LogUtil..cctor () (at /home/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 /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/linux_unity/app/swig/Firebase.App_fixed.cs:1924)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
Firebase.Firestore.FirebaseFirestore.get_DefaultInstance () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/firestore/src/FirebaseFirestore.cs:129)
FirebaseManager.Start () (at Assets/Scripts/UI+Menu+Settings/FirebaseManager.cs:27)
```

### If using CocoaPods for Apple platforms, the project's Podfile.lock

Expand Podfile.lock snippet

```yml

👀 Replace this line with the contents of your Podfile.lock!

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.