Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] System.DllNotFoundException: FirebaseCppApp-10_7_0 assembly:<unknown assembly> type:<unknown type> member:(null) #702

Closed
augusto-garcia-afterverse opened this issue May 4, 2023 · 6 comments
Labels
closed-by-bot needs-info Need information for the developer stale Don't have recent activity type: question unity-editor Issues related to Firebase usage in Unity editor

Comments

@augusto-garcia-afterverse
Copy link

augusto-garcia-afterverse commented May 4, 2023

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2021.3.18f1
  • Firebase Unity SDK version: 10.7.0
  • Source you installed the SDK: UPM
  • Problematic Firebase Component: All
  • Other Firebase Components in use: App, Messaging, Remote Config, Analytics
  • Additional SDKs you are using: Unnecessary for the issue
  • Platform you are using the Unity editor on: Mac
  • Platform you are targeting: iOS, Android, Desktop
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

When opening any project, for example any of the examples on https://github.com/firebase/quickstart-unity and running thee project on the editor on an older version from the MacOS (reproduced on Catalina and Big Sur), the bundle file is not able to be loaded.

Also, when running on the desktop platform, the bundle is also not being loaded.

Stacktrace looks similar to this:

Could not resolve all Firebase dependencies. Exception: 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 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: FirebaseCppApp-10_7_0 assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Firebase.AppUtilPINVOKE+SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_AppUtil(Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate,Firebase.AppUtilPINVOKE/SWIGExceptionHelper/ExceptionDelegate)
  at Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () [0x000ef] in <5bf999658a05487e815a1da9aeaa7664>:0 
   --- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at Firebase.AppUtilPINVOKE..cctor () [0x00000] in <5bf999658a05487e815a1da9aeaa7664>:0 
   --- End of inner exception stack trace ---
  at Firebase.AppUtil.SetLogFunction (Firebase.LogUtil+LogMessageDelegate arg0) [0x00001] in <5bf999658a05487e815a1da9aeaa7664>:0 
  at Firebase.LogUtil..ctor () [0x0000f] in <5bf999658a05487e815a1da9aeaa7664>:0 
  at Firebase.LogUtil..cctor () [0x00011] in <5bf999658a05487e815a1da9aeaa7664>:0 
   --- End of inner exception stack trace ---
  at Firebase.FirebaseApp..cctor () [0x00051] in <5bf999658a05487e815a1da9aeaa7664>:0 
   --- End of inner exception stack trace ---
  at PKGames.ThirdParty.Firebase.FirebaseManager.Initialize () [0x00014] in <f272b7ec956b4d3db4c200eee999a742>:0 

Steps to reproduce:

Run a project with the firebase integrated that initializes normally on the current Mac OS version (Ventura) - it will work properly.
Running on Mac OS Catalina or Big Sur - the above stacktrace is generated constantly.

I can provide a downlodable sample in private if needed. But it should occur with any firebase sample integrated with the latest firebase version.

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@augusto-garcia-afterverse augusto-garcia-afterverse changed the title [Bug] [Bug] System.DllNotFoundException: FirebaseCppApp-10_7_0 assembly:<unknown assembly> type:<unknown type> member:(null) May 4, 2023
@paulinon paulinon added unity-editor Issues related to Firebase usage in Unity editor and removed needs-triage new New issue. labels May 5, 2023
@AlmostMatt
Copy link
Contributor

AlmostMatt commented May 8, 2023

Hello. There are multiple possible causes of DllNotFoundException. Can you provide some additional information to rule out some of the following possibilities?

  1. Are the successful and failing devices both using the same version of Unity? Currently Unity 2019 is the minimum supported version by Firebase.

  2. Are either or both of the successful and failing devices using Intel processors? (check 'About this Mac')

  3. Can you verify the presence of the Cpp bundle in the failing project? It should be Firebase/Plugins/x86_64/FirebaseCppApp-10_7_0.bundle

Also verify in the Unity editor that if you select that bundle file, it is selected as CPU: "Any CPU"

  1. Debugging mac quarantining. The first time you attempt to depend on a firebase bundle on a mac device it typically quarantines the file and you need to go into security settings and allow it access to the firebase bundle.
    Did you see security popups on each of these devices about permission to run the firebase bundle?

Can you try running a terminal command to un-quarantine the file?
sudo xattr -d com.apple.quarantine Assets/Firebase/Plugins/x86_64/FirebaseCppApp-10_7_0.bundle

If that doesn't work, you can also try debugging whether or not some files are quarantined as described in this comment:
#510 (comment)

@AlmostMatt AlmostMatt added the needs-info Need information for the developer label May 8, 2023
@augusto-garcia-afterverse
Copy link
Author

augusto-garcia-afterverse commented May 9, 2023

  1. Are the successful and failing devices both using the same version of Unity? Currently Unity 2019 is the minimum supported version by Firebase.

All devices are on Unity 2021 LTS

  1. Are either or both of the successful and failing devices using Intel processors? (check 'About this Mac')

They were all Intel platforms.

  1. Can you verify the presence of the Cpp bundle in the failing project? It should be Firebase/Plugins/x86_64/FirebaseCppApp-10_7_0.bundle

It was present on all cases, the difference was, as I said, the MacOS version. The bundle does not work on MacOS Catalina and Big Sur, but works properly on Mac OS Ventura.

Also verify in the Unity editor that if you select that bundle file, it is selected as CPU: "Any CPU"

Yeah, this was correct as well.

  1. Debugging mac quarantining. The first time you attempt to depend on a firebase bundle on a mac device it typically quarantines the file and you need to go into security settings and allow it access to the firebase bundle.

That's the strange part, it did not show on the security settings as expected. We also tried the sudo xattr -d com.apple.quarantine Assets/Firebase/Plugins/x86_64/FirebaseCppApp-10_7_0.bundle command without success. The only thing we could do on our machines was to upgrade the MacOS so it works properly. Unfortunately, that's not an option for everyone.

If that doesn't work, you can also try debugging whether or not some files are quarantined as described in this comment:
#510 (comment)

This quarantine approach I actually did not try, I'll try it out.

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels May 9, 2023
@paulinon paulinon added needs-info Need information for the developer and removed needs-attention Need Googler's attention labels May 16, 2023
@google-oss-bot google-oss-bot added the stale Don't have recent activity label May 17, 2023
@google-oss-bot
Copy link

Hey @augusto-garcia-afterverse. 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!

@augusto-garcia-afterverse
Copy link
Author

I did find someone else with the issue that still has not updated the MacOS, currently testing to see if we can make it work for her. So far the procedures suggested did not work.

Just a side note: on the MacOS Ventura, the xattr atribute for quarantined files changed behaviour (now the key is com.apple.provenance instead). Could the issue be caused by this quarantine change on previous MacOS versions?

@google-oss-bot
Copy link

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

@augusto-garcia-afterverse 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.

@firebase firebase locked and limited conversation to collaborators Jul 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
closed-by-bot needs-info Need information for the developer stale Don't have recent activity type: question unity-editor Issues related to Firebase usage in Unity editor
Projects
None yet
Development

No branches or pull requests

4 participants