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.

[Bug] Firebase for Unity v10.0.1 Cannot run on Android Platform in Editor Mode!

See original GitHub issue

[REQUIRED] Please fill in the following fields:

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

[REQUIRED] Please describe the issue here:

When run in editor mode with switched to Android Platform, FirebaseApp cannot be construct staticly! See the following log:

DllNotFoundException: FirebaseCppApp-10_0_1 assembly: type: member:(null)
DllNotFoundException: FirebaseCppApp-10_0_1 assembly:<unknown assembly> type:<unknown type> member:(null)
Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/android_unity/armeabi-v7a/app/swig/Firebase.App_fixed.cs:3916)
Rethrow as TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception.
Firebase.AppUtilPINVOKE..cctor () (at /Users/runner/work/firebase-unity-sdk/firebase-unity-sdk/android_unity/armeabi-v7a/app/swig/Firebase.App_fixed.cs:3936)
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/android_unity/armeabi-v7a/app/swig/Firebase.App_fixed.cs:4646)
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/android_unity/armeabi-v7a/app/swig/Firebase.App_fixed.cs:1897)
Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception.
Pluto.LiteGame.Firebase.FirebaseInit.Awake () (at Assets/Scripts/Firebase/FirebaseInit.cs:27)
UnityEngine.Object:Instantiate(GameObject, Transform)
<InitDelayPrefabs>d__46:MoveNext() (at Assets/Scripts/UI/Common/AZ_GameInitLoading.cs:258)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)

In the log, we can find firebase-unity-sdk/android_unity/armeabi-v7a/app/swig, it is an android implement? why you use android implement in Editor mode? why not use an eiditor implement?

Due to this issue, I cannot use FirebaseApp anytime in Editor mode with Android Platform.

(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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
AlmostMattcommented, Nov 1, 2022

Reopening because as mentioned in https://github.com/firebase/firebase-unity-sdk/issues/449#issuecomment-1297966811, the other issue #449 mentioned docker containers or other context that does not apply here, so this is potentially a separate issue.

0reactions
google-oss-botcommented, Nov 29, 2022

Since there haven’t been any recent updates here, I am going to close this issue.

@CodeMasterYi if you’re still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug - Firebase for Unity causes Some Android Builds to Fail
For another project Android fails to build 100% of the time, while iOS builds normally and the game runs in Play Mode.
Read more >
Firebase Unity SDK Release Notes
To install this SDK, see Add Firebase to your Unity Project ... Fix #218 that Firebase editor tool not loading when iOS build...
Read more >
Troubleshooting & FAQ for Unity and Firebase
This page offers tips and troubleshooting for Unity-specific issues that you might encounter when using Firebase. Have other challenges or don't see your ......
Read more >
Unity integrated with firebase works on Unity Editor but not ...
Get config file for your Android app ... Go to your Project settings in the Firebase console. In the Your apps card, select...
Read more >
[Unity] Google Play sdk conflicts
Hi everybody,. I am already using Stan's Assets Android Native+Google Play for Unity SDK and i have a lot of conflicts between the...
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