现象
DllNotFoundException: FirebaseCppApp-11_5_0 assembly:<unknown assembly> type:<unknown 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:4114)
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:4134)
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:4844)
...
排错关键
在UnityEditor依次 选中Assets\Firebase\Plugins\x86_64下的3个dll,在Inspector面板勾选Load on startup,然后点击Apply:
其中,FirebaseCppAnalytics.dll没有任何反应。但另外两个dll,只要勾上Load on startup,立即报如下错误:
Dependency Walker报缺少icu.dll:
检查Win10操作系统,版本低于1903:
原因
firebase v11版需要icu.dll实现全球化服务,但版本较低的windows系统缺少该文件。
解决办法
找到icu.dll复制倒系统中。结果,仍然不行。可能仍然是有什么文件没有复制过来。
考虑升级win10最简单。