nuget包Xamarin.Firebase.iOS.CloudMessaging 3.1.2的问题 [英] Issue with nuget package Xamarin.Firebase.iOS.CloudMessaging 3.1.2

查看:34
本文介绍了nuget包Xamarin.Firebase.iOS.CloudMessaging 3.1.2的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果安装Xamarin.Firebase.iOS.CloudMessaging 3.1.2 nuget程序包,则会收到许多错误消息.

I get many error messages if I install the Xamarin.Firebase.iOS.CloudMessaging 3.1.2 nuget package.

错误:链接器命令失败,退出代码为1(使用-v查看调用)

Error: linker command failed with exit code 1 (use -v to see invocation)

错误MT5210:本机链接失败,未定义符号:_FIRLogBasic.请确认已引用了所有必要的框架,并且正确链接了本机库.

Error MT5210: Native linking failed, undefined symbol: _FIRLogBasic. Please verify that all the necessary frameworks have been referenced and native libraries are properly linked in.

错误MT5211:本机链接失败,未定义的Objective-C类: FIROptions.找不到符号"_OBJC_CLASS _ $ _ FIROptions" 在与您的应用程序链接的任何库或框架中.

Error MT5211: Native linking failed, undefined Objective-C class: FIROptions. The symbol '_OBJC_CLASS_$_FIROptions' could not be found in any of the libraries or frameworks linked with your application.

错误MT5211:本机链接失败,未定义的Objective-C类: GULAppEnvironmentUtil.符号 在以下任何位置都找不到"_OBJC_CLASS _ $ _ GULAppEnvironmentUtil" 与您的应用程序链接的库或框架.

Error MT5211: Native linking failed, undefined Objective-C class: GULAppEnvironmentUtil. The symbol '_OBJC_CLASS_$_GULAppEnvironmentUtil' could not be found in any of the libraries or frameworks linked with your application.

错误MT5201:本机链接失败.请查看构建日志并 提供给gcc的用户标志:-ObjC

Error MT5201: Native linking failed. Please review the build log and the user flags provided to gcc: -ObjC

错误MT5202:本机链接失败.请查看构建日志.

Error MT5202: Native linking failed. Please review the build log.

我尝试卸载并重新安装nuget软件包,但仍然遇到相同的错误.

I tried uninstalling and reinstalling the nuget package but I still get the same errors.

我使用Visual Studio Community for Mac 8.1.5(内部版本9).

I use Visual Studio Community for Mac 8.1.5 (build 9).

我需要Xamarin.Firebase.iOS.CloudMessaging,因为我遵循此教程: https://www.robbiecode.com/setup-push-notifications-with-firebase-in-xamarin-forms-for-ios/

I need Xamarin.Firebase.iOS.CloudMessaging because I follow this tutorial: https://www.robbiecode.com/setup-push-notifications-with-firebase-in-xamarin-forms-for-ios/

我的项目有什么问题?我该怎么办?

What is wrong with my project? What can I do?

以下两个项目在我的解决方案中: InapppurchaseTest.iOS,MonoGame.Framework.iOS(开发)

The following two projects are in my solution: InapppurchaseTest.iOS, MonoGame.Framework.iOS (develop)

推荐答案

好吧,这是Firebase和Xamarin的一个众所周知的问题,这里发生的基本上是旧的bin和obj文件,而与新数据进行交互会覆盖一些iOS部署时合成IPA所需的现有文件,因此最终会引发链接相关错误,请按照以下步骤操作,它将清除此混乱情况.

Well, this is a well-known issue with Firebase and Xamarin, what basically happens here is the old bin and obj files while interacting with the new data override some existing files that are needed by iOS to synthesize the IPA while deployment and hence ends up throwing linking RELATED errors, follow the below steps and it will clear this mess.

  • 清理bin和obj
  • 在MAC机器的以下路径中删除构建-〜/Library/Caches/Xamarin/mtbs/builds/ ProjNAME ,其中"ProjName"是您当前正在从事的项目
  • 完成上述两个步骤后,添加 Xamarin.Firebase.iOS.CloudMessaging 程序包,并将链接器设置更改为不链接"(暂时)
  • 安装这些软件包后,请确保您明智地构建项目依赖关系,这意味着首先要使用PCL'S和.Net标准,然后是本机iOS项目.
  • 如果第一次构建无效,请再次清理bin和obj ...
  • Clean bin and obj
  • Delete the builds in the following path of your MAC machine - ~/Library/Caches/Xamarin/mtbs/builds/ProjNAME where 'ProjName' is the name of the project you are currently working on
  • Once you are done with both the above steps add the Xamarin.Firebase.iOS.CloudMessaging package and change linker setting to Don't Link (this is for the time being)
  • After installing these packages see to it that you build your project dependency wise which means PCL'S and .Net standards first then the native iOS project.
  • Clean bin and obj again if it does not work for the first build...

如果不重复上述过程,这应该可以解决您的问题.

This should solve your issues in case it does not repeat the above procedure.

如果您在此处中查看SotoiGhost的GitHub注释,说在项目的任何地方添加以下行应该可以解决此问题...

If you check the GitHub comment by SotoiGhost here, it says adding the below line anywhere in your project should solve this issue...

var foo = Firebase.Core.Configuration.SharedInstance;

如有问题,请随时回来

祝你好运!

这篇关于nuget包Xamarin.Firebase.iOS.CloudMessaging 3.1.2的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆