2

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)

enter image description here

1 Answer 1

5

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!

11
  • There is no Xamarin/mtbs folder in Caches. I have two folders in Caches: Xamarin.Android and XamarinBuildDownload. But there is no mtbs folder in these folders.
    – Hobbit7
    Jul 22, 2019 at 11:11
  • Do you have Visual Studio for mac?
    – FreakyAli
    Jul 22, 2019 at 11:28
  • Yes, Visual Studio for Mac Community 8.1.5 (build 9).
    – Hobbit7
    Jul 22, 2019 at 12:23
  • I did the first step(I deleted bin, obj and .vs folders) and the third step but I still get the same error messages. In addition, I cleaned and rebuild my solution in Visual Studio. I don't know how to do step 4: "PCL'S and .Net standards first then the native iOS project." How can I influence the build order? I added a picture of my solution in VS.
    – Hobbit7
    Jul 22, 2019 at 15:02
  • 1
    This line of code solved the problem: var foo = Firebase.Core.Configuration.SharedInstance; Now, I get no more error messages. I found the code here: github.com/xamarin/GoogleApisForiOSComponents/issues/158
    – Hobbit7
    Jul 23, 2019 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.