Issue with nuget package Xamarin.Firebase.iOS.CloudMessaging 3.1.2

别来无恙 提交于 2020-05-24 05:50:31

问题


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

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

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.

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.

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.

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

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

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

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

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?

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


回答1:


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.

  • 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.

EDIT

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;

Feel free to get back in case of issues

Good luck!



来源:https://stackoverflow.com/questions/57131541/issue-with-nuget-package-xamarin-firebase-ios-cloudmessaging-3-1-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!