gpt4 book ai didi

c# - 在 Unity 上安装 Firebase 时,出现错误 "Unloading broken assembly"

转载 作者:搜寻专家 更新时间:2023-11-01 09:22:34 53 4
gpt4 key购买 nike

我打算引入 Firebase 为我用 Unity 制作的游戏添加推送通知功能。

我将特定于应用程序的 google-services.json 粘贴到 Assets 文件夹中,我安装了从 here 下载的 SDK 的 FirebaseMessaging.unitypackage , 但我得到一个错误。


控制台

Unloading broken assembly Assets/Firebase/Plugins/Firebase.App.dll, this assembly can cause crashes in the runtime


Unloading broken assembly Assets/Firebase/Plugins/Firebase.Messaging.dll, this assembly can cause crashes in the runtime


Unloading broken assembly Assets/Firebase/Plugins/Firebase.Platform.dll, this assembly can cause crashes in the runtime


Generation of the Firebase Android resource file google-services.xml from Assets/google-services.json failed. If you have not included a valid Firebase Android resources in your app it will fail to initialize. C:/UnityProjects/Test/Assets..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe -i "Assets/google-services.json" -l. Microsoft.VC90.CRT.manifest could not be extracted! You can start to diagnose this issue by executing "C:/UnityProjects/Test/Assets..\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe -i "Assets/google-services.json" -l." from the command line. UnityEngine.Debug:LogError(Object) Firebase.Editor.GenerateXmlFromGoogleServicesJson:RunResourceGenerator(String, String, Boolean) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:508) Firebase.Editor.GenerateXmlFromGoogleServicesJson:ReadBundleIds(String) (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:369) Firebase.Editor.GenerateXmlFromGoogleServicesJson:UpdateConfigFileDirectory() (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:261) Firebase.Editor.GenerateXmlFromGoogleServicesJson:CheckConfiguration() (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:223) Firebase.Editor.GenerateXmlFromGoogleServicesJson:.cctor() (at Z:/tmp/tmp.CeTbzghE2x/firebase/app/client/unity/editor/src/GenerateXmlFromGoogleServicesJson.cs:83) UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes()


我想添加这个;

public void Start() {
Firebase.Messaging.FirebaseMessaging.TokenReceived += OnTokenReceived;
Firebase.Messaging.FirebaseMessaging.MessageReceived += OnMessageReceived;
}

但由于错误,我在 OnTokenReceivedOnMessageReceived 部分出现错误。

使用 Firebase 为应用程序创建的 google-services.json 是否存在问题?任何人请解决我。

最佳答案

检查您的项目设置 > IOS。确保 .NET 是 4.X 而不是 3。 https://docs.unity3d.com/Manual/ScriptingRuntimeUpgrade.html

关于c# - 在 Unity 上安装 Firebase 时,出现错误 "Unloading broken assembly",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53519283/

53 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com