工程中导入Firebase Analytisc dotnet4的库后,编辑器下报错如下:
System.TypeInitializationException: The type initializer for 'Firebase.Editor.Measurement' threw an exception. ---> System.MissingMethodException: void Google.EditorMeasurement.set_InstallSourceFilename(string)--- End of inner exception stack trace ---at Firebase.Editor.AndroidSettingsChecker..cctor () [0x0000c] in Z:\tmp\tmp.pxoeYNk3oG\firebase\app\client\unity\editor\src\AndroidAPILevelChecker.cs:37
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])
同时打出的ios包Firebase也疯狂报错。
报错原因分析:
1,之前导入过Firebase库,又导入了,存在冲突
2,项目包名改了,同步有问题
解决步骤(详见 这里):
- Deleting anything called
ExternalDependencyManager
![在这里插入图片描述](https://img8.php1.cn/3cdc5/1600b/9f3/96e95c8365850b4f.png)
- Deleting anything called
PlayServicesResolver
![在这里插入图片描述](https://img8.php1.cn/3cdc5/1600b/9f3/bab713a190ec1e44.png)
- then download the most recent version of EDM4U,and import it to Unity.
Firebase Analytics Quickstart 对Firebase Analytics的集成有比较详细的描述,值得参考