Closed ClairePeta-36 closed 4 months ago
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Thanks for reaching out, @ClairePeta-36. Firebase version 12.0.0
+ requires a higher version of AGP and Gradle to work. I'm not sure if manually updating the Gradle is enough to fix the issue, since it also relies on the AGP version as well. In this case, could you try using version 2022.3.41f1
and see if it works? Thanks!
@argzdev , I tried with 2022.3.41f1 but still same error. It doesn't happen when I install the built apk to an android device. However, in editor, in play mode it always shows up.
DllNotFoundException: FirebaseCppApp-12_0_0 assembly:<unknown assembly> type:<unknown 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)
The project is at the latest unity supported gradle (com.android.tools.build:gradle:7.4.2).
This is really annoying. Google set a deadline to target API level 34. Firebase brings Android 14 support after 12.0.0. And we still dealing with dll errors.
Could you answer a few questions below:
Just as a sanity check, you mentioned that you're using the latest version of ED4MU. We recently fixed an issue with the unity-jar-resolver, and released it last week in version 1.2.182
. Are you using this version? I noticed that our Packages download page is still linked to the old version 1.2.177
for latest versions of Firebase Unity SDKs 12.2.0
. I think this might've cause the confusion.
Also have you tried to use the Resolve
or Force Resolve
option:
What Firebase products are you using? Do you have an MCVE for us to investigate this further?
This is really annoying. Google set a deadline to target API level 34. Firebase brings Android 14 support after 12.0.0. And we still dealing with dll errors.
Sorry you have to deal with this mess. Unfortunately, this is a mix of version incompatibility where AGP, Gradle, ED4MU, and Unity Editor needs to have the correct versions to work properly. But this has been resolved, and should work with the latest versions.
In any case, according to the Unity forums regarding API 34 issues, you may also request for an extension:
The deadline for targeting API 34 is August 31 - what if I don’t have enough time?
- We have informed Google about the impact of this AGP issue to Unity Creators. You are allowed to request an extension until November using the usual Google Play Console / Policy pages 16. Usually this opens around the beginning of August. Please mention Unity 2021 and AGP/Legacy Library issues in your extension request.
@argzdev , Thanks for your quick response. I use Android Resolver version 1.2.182. I tried Firebase 12.2.0 too with this resolver version, it still throws the same error. Please note that, I can build it and run it in a real Android device. There is no problem in an Android device (with Android 14). This only happens in Editor, in Play mode. I have many remote controls from Firebase RemoteConfig. So, the DLL error at the beginning, even for Editor's play mode, makes my development very difficult. It completely disables remote config activities.
2- I tried both of them, there is still error :( 3- FirebaseAnalytics, FirebaseMessaging, FirebaseRemoteConfig.
The error starts when it calls RemoteConfig methods as the following:
DllNotFoundException: FirebaseCppApp-12_2_0 assembly:<unknown assembly> type:<unknown 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. Rethrow as TypeInitializationException: The type initializer for 'Firebase.FirebaseApp' threw an exception. Firebase.RemoteConfig.FirebaseRemoteConfig.get_DefaultInstance () (at /home/runner/work/firebase-unity-sdk/firebase-unity-sdk/remote_config/src/FirebaseRemoteConfig.cs:164)
Thanks for the extra details, @seanlcnr. Hmm, that's interesting. I tried testing with our Firebase Unity Quickstart adding Firebase SDK v12.2.0
via Import Asset
or Package Manager
. Both methods seems to run correctly in the Unity Editor 2022.3.40f1
or with the built Android app.
I'm wondering, if it works on building an Android app, could it be a permission error? Can you check this Stack Overflow thread:
- Remove Firebase and external library folder from Assets.
- Import again.
- Run Unity, you will get popup of unidentified developer. And you have only two options in popup so you can select to move to bin.
- Then in system preferences -> Allow bundle.
- Open Bin and drag and drop deleted bundle which is "FirebaseCppApp-11_6_0.bundle" to Assets in Unity.
- Make sure settings allow that bundle.
- Run Unity and it will run project successfully!
Either that, or the Firebase packages were not imported properly. You might have to try re-importing all Firebase packages including the ED4MU and then do a clean build. In case you've used Assets > Import Package > Custom Package
, you can use Assets > External Dependency Manager > Version Handler > Uninstall Managed Packages
to properly remove all added Firebase assets to make sure no random files are left before adding via Package Manager
.
Let me know if these help!
@argzdev thanks for your detailed guide.
I did apply everything you said, but it still throws the same error. I also tried opening Unity as administrator mode.
FirebaseCppApp-12_2_0.dll
FirebaseCppApp-12_2_0.so
FirebaseCppApp-12_2_0.bundle
These files are under Assets/Firebase/Plugins/x86_64 folder. My OS is Windows 10 Enterprise LTSC - 64-bit. Does it really check exaclty this folder? Should I move these files to another folder? I think this is only a "read" operation. It doesn't try to write/change these files, it only reads, but cannot find the file some how. Does it still need an additional permission at the OS level?
By the way, Firebase version 11_1_0 works fine on the same OS, same Unity version, same project. However, it doesn't support Android 14 I guess. So I have to stay at 12_0_0+
I'm finding that recently the latest Firebase and ED4MU DLLs keep changing their platform settings either unmarking the current platform or unmarking all platforms which causes DLL not found errors like the one you've encountered.
ExternalDependencyManager/Editor/1.2.182/
have Editor ticked as an included platformFirebase/Plugins/
have Editor/Standalone/Android marked as included platforms for Firebase.Analytics.dll, Firebase.App.dll, Firebase.Crashlytics.dll, Firebase.Installations.dll, Firebase.Messaging.dll (or more depending on firebase modules being used) and Firebase.Platform.dll, Firebase.TaskExtension.dll and Google.MiniJson.dll include Editor/Standalone/iOS/AndroidFirebase/<platform folder>
have that platform selected marked as includedI'm not sure what causes these platform settings to change but I've ran into this issue multiple times with different projects since updating to Firebase 12.2.0
Hi @Seanm07 , thanks for your answer. They are all Editor ticked. The error still remains.
Did you solve this in your case?
Years ago, I was in trouble with another Firebase error and it was solved in almost 3 years with a new Firebase release:) Hope this one will be solved earlier.
Thanks for the extra details, @seanlcnr. So far, I'm unable to reproduce the same behavior. I'm wondering if the issue is due to the different OS being used. Currently, I'm testing with a macOS Sonoma 14.6.1
, we don't have a Windows device ready for testing, so we'll try and figure something out. By the way, is there any difference in behavior if you import the Firebase SDK using the Assets > Import Package > Custom Package
?
We are still experiencing this issue on all android builds, our IOS and windows builds are running as expected; we have noticed that when we open the apk in Android studio the file can be seen in the lib folder as shown below We have tried updating to the latest unity version; 2022.3.43f1 with no difference, we have currently downgraded to the 11.9.0 firebase and targeting API 33 to see if that resolves the issue but so far no difference. We have tried all the version of EDM ranging from the one installed with the 11.9.0 firebase packages up to the latest release. Also tried on numerous computer with fresh installs of unity just incase it was something local
Sorry, we're still unable to reproduce the same behavior. Are you able to reproduce this behavior on a fresh project? If so, could you share with us an MCVE, so we can investigate further?
This morning i have tested a brand new project in 2022.3.35f1. Installed the gpgs-0.11.0 unity package, FirebaseCrashlytics_11.9.0 package, and the FirebaseAnalytics_11.9.0 package. I added a script to init firebase (FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread()) on start. and on an android build i am still receiving the following error
It could be a configuration issue, but again, without a proper MCVE, it'll be difficult for us to investigate this further especially since we aren't encountering this behavior on our side. You may also try using our Firebase Quickstart for references. Thanks
谢谢你提供更多详细信息,@seanlcnr。嗯,这很有趣。我尝试使用我们的Firebase Unity Quickstart
v12.2.0
通过Import Asset
或添加 Firebase SDK进行测试Package Manager
。这两种方法似乎都可以在 Unity 编辑器2022.3.40f1
或内置的 Android 应用中正确运行。我想知道,如果它可以构建 Android 应用,那么这可能是权限错误吗?您可以查看这个Stack Overflow 线程吗:
- 从 Assets 中删除 Firebase 和外部库文件夹。
- 再次导入。
- 运行 Unity,您将看到未识别开发人员的弹出窗口。弹出窗口中只有两个选项,您可以选择将其移至 bin。
- 然后在系统偏好设置->允许捆绑。
- 打开 Bin,将已删除的 bundle “FirebaseCppApp-11_6_0.bundle” 拖放到 Unity 中的 Assets 中。
- 确保设置允许该捆绑。
- 运行Unity,项目将成功运行!
要么是 Firebase 包没有正确导入。您可能必须尝试重新导入所有 Firebase 包(包括 ED4MU),然后进行全新构建。如果您使用了
Assets > Import Package > Custom Package
,则可以使用Assets > External Dependency Manager > Version Handler > Uninstall Managed Packages
正确删除所有添加的 Firebase 资产,以确保在通过 添加 之前没有遗留任何随机文件Package Manager
。如果这些有帮助的话请告诉我! This worked for me, I also had the same error, I tried to delete all firebase packages and import the latest Firebase version 12.2.0 successfully resolved this error
Hi @Ls9257 . Thanks for your suggestion. Unfortunately, my condition still remains.
Btw, I just upgraded Firebase to 12.2.1. Nothing changed, there is still the same error.
I am experiencing the exact same issue. The error only occurred when I upgraded my project to use the latest Firebase SDK in order to support the new Target API Level.
Firebase Unity SDK Version 12.2.1
Unity editor version 2022.3.45f1
Installation Method .unitypackage
Problematic Firebase Component(s) Auth
Targeted Platform(s) Editor
Unity editor platform Ubuntu 20.04
Scripting Runtime IL2CPP
Could the problem be a dependency issue. What is the required GLIBC version?
I ran a dependency check and got this:
~/git/FirebaseSample/Assets/Firebase/Plugins/x86_64$ ldd FirebaseCppApp-12_2_1.so
./FirebaseCppApp-12_2_1.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./FirebaseCppApp-12_2_1.so)
./FirebaseCppApp-12_2_1.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./FirebaseCppApp-12_2_1.so)
./FirebaseCppApp-12_2_1.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./FirebaseCppApp-12_2_1.so)
linux-vdso.so.1 (0x00007ffff5377000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fc7c0bd9000)
libsecret-1.so.0 => /usr/lib/x86_64-linux-gnu/libsecret-1.so.0 (0x00007fc7c0b78000)
libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fc7c0a4e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fc7c07e0000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc7c0691000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fc7c066a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc7c0478000)
/lib64/ld-linux-x86-64.so.2 (0x00007fc7c4f57000)
libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fc7c035a000)
libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007fc7c0178000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007fc7c0118000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc7c00f5000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fc7c0080000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fc7c005d000)
libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007fc7c0057000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc7c0051000)
libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007fc7bfff1000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fc7bffc6000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fc7bffa8000)
libffi.so.7 => /usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007fc7bff9c000)
libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007fc7bff45000)
libpcre2-8.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007fc7bfeb4000)
Created a minimal test project: https://github.com/grantwwoodford/FirebaseSample
Perhaps you can reproduce on Ubuntu 20.04 if it is related to some OS library?
The issue went away when I upgraded to Ubuntu 22.04.
Hey @ClairePeta-36. 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!
Since there haven't been any recent updates here, I am going to close this issue.
@ClairePeta-36 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.
Hello, I'm also still having this issue. My setup: OS: windows 11 Target: Android (min 12, target: highest) Unity version: 2022.3.47f1 Firebase parts included: Messaging, Analytics
Other plugins: vuforia
Testing on device: Xiaomi Redmi 12 with Android 14
The error i'm getting is the following:
DllNotFoundException: Unable to load DLL 'FirebaseCppApp-12_2_1'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-12_2_1' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-12_2_1" not found
The script I'm using to init Firebase is the following:
using UnityEngine;
using Firebase.Extensions;
public class FireBaseInit : MonoBehaviour{
// Start is called before the first frame update
void Start(){
print("Starting firebase...");
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>{
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available){
// Create and hold a reference to your FirebaseApp,
// where app is a Firebase.FirebaseApp property of your application class.
Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance;
// Set a flag here to indicate whether Firebase is ready to use by your app.
print("Firebase initialized.");
}else{
UnityEngine.Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}", dependencyStatus));
// Firebase Unity SDK is not safe to use here.
}
});
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
}
public void OnTokenReceived(object sender, Firebase.Messaging.TokenReceivedEventArgs token){
UnityEngine.Debug.Log("Received Registration Token: " + token.Token);
}
public void OnMessageReceived(object sender, Firebase.Messaging.MessageReceivedEventArgs e){
UnityEngine.Debug.Log("Received a new message from: " + e.Message.From);
}
}
Which is basically the standard first thing you try, according to the documentation provided here: https://firebase.google.com/docs/unity/setup
In the editor, I'm also having this persistent error:
Assembly 'Assets/ExternalDependencyManager/Editor/1.2.182/Google.IOSResolver.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.
Since I'm on windows, I obviously can't having related to XCode
I had the same problem with Mac OS. Solution: In Finder, open the FirebaseCppApp-12_2_0.bundle file in any text editor. A warning about an unknown developer will appear. Confirm, close the editor and the error will disappear in the UNITY editor.
Здравствуйте, у меня также все еще возникает эта проблема. Мои настройки: ОС: Windows 11 Цель: Android (минимум 12, цель: самая высокая) Версия Unity: 2022.3.47f1 Включены компоненты Firebase: обмен сообщениями, аналитика
Другие плагины: vuforia
Тестирование на устройстве: Xiaomi Redmi 12 с Android 14
Ошибка, которую я получаю, заключается в следующем:
DllNotFoundException: Unable to load DLL 'FirebaseCppApp-12_2_1'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-12_2_1' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-12_2_1" not found
Скрипт, который я использую для инициализации Firebase, следующий:
using UnityEngine; using Firebase.Extensions; public class FireBaseInit : MonoBehaviour{ // Start is called before the first frame update void Start(){ print("Starting firebase..."); Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>{ var dependencyStatus = task.Result; if (dependencyStatus == Firebase.DependencyStatus.Available){ // Create and hold a reference to your FirebaseApp, // where app is a Firebase.FirebaseApp property of your application class. Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance; // Set a flag here to indicate whether Firebase is ready to use by your app. print("Firebase initialized."); }else{ UnityEngine.Debug.LogError(System.String.Format( "Could not resolve all Firebase dependencies: {0}", dependencyStatus)); // Firebase Unity SDK is not safe to use here. } }); Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived; Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived; } public void OnTokenReceived(object sender, Firebase.Messaging.TokenReceivedEventArgs token){ UnityEngine.Debug.Log("Received Registration Token: " + token.Token); } public void OnMessageReceived(object sender, Firebase.Messaging.MessageReceivedEventArgs e){ UnityEngine.Debug.Log("Received a new message from: " + e.Message.From); } }
Это, по сути, стандартное первое, что вы пытаетесь сделать, согласно представленной здесь документации: https://firebase.google.com/docs/unity/setup
В редакторе у меня также возникает эта постоянная ошибка:
Assembly 'Assets/ExternalDependencyManager/Editor/1.2.182/Google.IOSResolver.dll' will not be loaded due to errors: Unable to resolve reference 'UnityEditor.iOS.Extensions.Xcode'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.
Поскольку я на Windows, я, очевидно, не могу иметь отношения к XCode
I found that firebase must be placed in the Assets\Firebase directory. If this directory level is changed, the above problem will occur
This is when I changed the firebase directory to Assets\SDK\Firebase and found that there was no baseCppApp-12_3_0.so in the lib library
this is right ...,I don't know where the problem is ?
Description
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 'Firebase.AppUtilPINVOKE.SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'FirebaseCppApp-12_0_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-12_0_0' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-12_0_0" not found
DllNotFoundException: Unable to load DLL 'FirebaseCppApp-12_0_0'. Tried the load the following dynamic libraries: Unable to load dynamic library 'FirebaseCppApp-12_0_0' because of 'Failed to open the requested dynamic library (0x06000000) dlerror() = dlopen failed: library "FirebaseCppApp-12_0_0" not found
Reproducing the issue
We are in the process of updating out app to unity 2022.3.35f1 We updated our firebase version from 9.1.0 to 12.1.0. while the build succeeds, on arriving to the home screen we get the above errors. We have done some research into others who have faced this problem however none of their fixes have worked for us
Attempted Resolutions:
Firebase Unity SDK Version
12.1.0
Unity editor version
2022.3.35f1
Installation Method
.unitypackage
Problematic Firebase Component(s)
No response
Other Firebase Component(s) in use
Analytics, Crashlytics, In-App Messaging, Remote Config
Additional SDKs you are using
No response
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
No response
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! ```