Forum Libraries, Components, and Plugins


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Adding Xamarin.Google.iOS.SignIn results in a native linking error (MT5209)



  • BillHolmesBillHolmes USXamarin Team Xamurai

    @anthonybalmes, have you added the Cast Nuget to your app project? Are you able to share a project that reproduces the error or a gist of your build output? Diagnostic level output of a rebuild which you can set in XS preferences dialog.

  • anthonybalmesanthonybalmes USMember ✭✭
    edited May 2016

    @BillHolmes, Unfortunately, I cannot share my project with you. To give you an overview, I currently have 2 projects inside a solution, one of them has the modified cast example code, and the other is the project that I am using the cast code on. I just rebuilt my code just now to get the build log and the error changed to

    error MT4116: Could not register the assembly 'GoogleCaster': System.NullReferenceException: Object reference not set to an instance of an object

    I'm not sure if we can continue talking about this in this thread since its a different topic now.

    EDIT: The error I showed above happened after I turned the Google.Cast Local Copy Field to be false, when I changed it to true, the original error showed up

  • anthonybalmesanthonybalmes USMember ✭✭

    I also checked the version number of the reference of the Google.Cast( and the Package version number(2.10.4), are they supposed to be different?

  • LukePothierLukePothier USMember ✭✭

    @BillHolmes, I am still experiencing the issue.

    Xamarin.Google.iOS.Analytics., and

    I've attached a screenshot of the error I get, which is the same as it was with the old libraries. Please let me know if there's any other information I can provide to help to get the fix out as quickly as possible.

  • BenonCzornijBenonCzornij ZAMember ✭✭

    @GoMobileAS , im experiencing your exact same issue with Google Maps and Google Analytics , after updating analytics and maps components this morning:

    /Users/../MTOUCH: Error MT5209: Native linking error: file not found: /Users/../obj/iPhoneSimulator/Debug/mtouch-cache/libGoogleAnalytics.a (MT5209)

    Have you found any solutions perhaps?

  • BillHolmesBillHolmes USXamarin Team Xamurai

    @anthonybalmes, @LukePothier , @BenonCzornij,

    All of our test scenarios are working. Here are some items for you to check.

    • Have you added the NuGet to the app project? There are build targets that need to run as part of the app build. If you only add the NuGet to a Library project and not the App it will compile but not link.
    • Be sure to clean out all bin and obj folders. The most recent bug dealt with time stamps on the extracted files in the NuGet package. The files had a date in the future. Failing to clear out these files could result in the original 'bad' files being used.
      • Also check the date of the extracted dlls in the packages folder? Are they past dates?
    • Do the sample apps build for the Component? If the samples build, what is different about your project? Are there other NuGets installed? If you begin to remove other NuGets does it start building correctly?

    You should be using Xamarin.Build.Download 0.2.1 and should not be using the Local Copy = false workaround.

    Any additional information or samples that you can provide will help me to better understand why this does not work for you.

  • NickHitchinsNickHitchins NZMember

    Hi @BillHolmes,

    I am currently trying out the solutions that you posted one by one, and after I added the nuget cast package in my app project I got another error.

    /Users/xxxxxx/iOSPlayerApp/packages/Xamarin.Build.Download.0.2.1/build/Xamarin.Build.Download.targets: Error: Could not find a part of the path "/Users/xxxxxx/iOSPlayerApp/packages/.xbcache/GCstSDK-2.10.2/GoogleCastSDK-2.10.4-Release/GoogleCast.framework/Versions/A/GoogleCast". at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) <0x1a03aa0 + 0x0021d> in :0
    at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) <0x1a03650 + 0x00051> in :0
    at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
    at System.IO.File.OpenRead (System.String path) <0x1a00b30 + 0x0004c> in :0
    at Xamarin.Build.Download.XamarinBuildiOSResourceRestore.MergeResources (IAssemblyResolver resolver, System.String originalAsmPath, System.String mergedAsmPath, System.Collections.Generic.List`1 resourceItems) <0x3ba6ce8 + 0x00293> in :0

  • anthonybalmesanthonybalmes USMember ✭✭
    edited May 2016

    Hi @BillHolmes
    That was my post above, I accidentally used my colleagues account to reply to this thread

    EDIT: I tried running the sample code again without doing anything and it built fine, it broke when I tried updating it to the newest version of the Google.Cast package with the same error as above

    EDIT 2: I tried going to the path where the error was appearing above to the xbcache level and I only found the folder for GCstSDK-2.10.2 in there and not the 2.10.4 version. I deleted this folder and did a clean action in Xamarin. It still gave the same error and I check the path again and the 2.10.2 folder is back in the path.

  • LukePothierLukePothier USMember ✭✭

    @BillHolmes I am getting the same errors as yesterday. I manually cleaned out all of the bin and obj folders, made sure I was using all of the correct versions of the packages, and checked the dates on all the .dlls. I am using:

    Xamarin.Google.iOS.Maps., and

    in my iOS project, and


    in my PCL (I don't know if the PCL needs it, but discluding it doesn't change my errors). None of my .dlls are using the Copy Local = false hack.

  • BillHolmesBillHolmes USXamarin Team Xamurai

    @LukePothier Are you able to build the samples that are provided in the component store?

  • LukePothierLukePothier USMember ✭✭

    @BillHolmes no I wasn't, I got some other weird build errors with those. I can go and get the errors for you if you need me to. Are those samples using the current version of Google Maps?

  • BillHolmesBillHolmes USXamarin Team Xamurai
    edited May 2016


    The samples should be up to date. Check the packages config file to be sure. Maps 1.13.1 is what you are looking for.

    Could you set your build log level to diagnostic and share the entire build output for a clean build in a gist?

  • LukePothierLukePothier USMember ✭✭

    @BillHolmes, I have messaged you directly.

  • BillHolmesBillHolmes USXamarin Team Xamurai

    @LukePothier , @BenonCzornij,

    I have provided an update to Xamarin.Google.iOS.Analytics that should address the issue you are seeing.

    There was a conflict of property names between Analytics and Maps.

  • BillHolmesBillHolmes USXamarin Team Xamurai


    Please delete the entire .xbcache folder. A rebuild will rebuild it.

    You can also try and remove all files from the user's cache folder.


  • LukePothierLukePothier USMember ✭✭

    Can confirm Analytics v3.14.0.5 fixed my issue. Thanks Bill!

  • BenonCzornijBenonCzornij ZAMember ✭✭

    I can also confirm that the Analytics v3.14.0.5 fixed my issue. thanks @BillHolmes :smile:

  • TArndtTArndt DEMember

    thanks @BillHolmes
    When do you think is the "Xamarin.Build.Download 0.2.2" final? Are there any kown problems?

  • BillHolmesBillHolmes USXamarin Team Xamurai

    @TimoArndt there should be no need for version 0.2.2. The only change from 0.2.1 was a workaround to set LocalCopy to false. The most recent versions of Xamarin.Google.iOS.* do not require the LocalCopy workaround.

  • anthonybalmesanthonybalmes USMember ✭✭

    Hi @BillHolmes,

    I forgot to reply in this thread, but your recommendation of deleting .xbcache worked! Thanks a lot!

    On another note, I noticed that the example for the Google Cast only shows connecting and disconnecting from the Cast device. I was wondering if there was an example to show how to control the video being casted through the app. ie. play/pause the video


  • MarcoRinaldiMarcoRinaldi ITMember ✭✭

    I've solved the same problem with Google Analytics on Xamarin iOS installing Xamarin.Build.Download 0.2.2-beta1

    I hope this will become as soon as possible the stable version.

    Best regards

  • JohnyKamnangJohnyKamnang BEMember ✭✭

    Hi all,

    I try to work with Google Analytics for iOS and I have the same issue..

    I've followed everything in this post but it doesn't work

    • copy local set to false
    • Delete the .XBcache

    Does someone got an idea?


  • XamEnXamEn USMember ✭✭

    Hi all,

    Error 1 Unpacking failed. Please download '' and extract it to the 'D:\Xamarin\Developments\IOS\GoogleMapsDirections2\GoogleMapsDirections\packages.xbcache\GMaps-1.13.2' directory and create an empty file called 'D:\Xamarin\Developments\IOS\GoogleMapsDirections2\GoogleMapsDirections\packages.xbcache\GMaps-1.13.2.unpacked'. GoogleMapsDirections

    I am getting everytime above error while trying to build a solution which includes google maps for ios component

  • XamEnXamEn USMember ✭✭

    could anyone please suggest the solution to above mentioned problem

  • GaborFurediGaborFuredi HUMember ✭✭

    @BillHolmes I have the same issue with an iOS Keyboard Extension project. (I've added Google Analytics successfully to the container iOS app, now I wanted to add the GA Nuget to the Keyboard Extension as well).

    Linking fails:

    /Users/gable/Documents/Dev/Xamarin/ArabMoji/KeyboardExt/MTOUCH: Warning MT1302: Could not extract the native library 'libGoogleAnalytics.a' from '/Users/gable/Documents/Dev/Xamarin/ArabMoji/KeyboardExt/obj/iPhoneSimulator/Debug/mtouch-cache/libGoogleAnalytics.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary'). (MT1302) (KeyboardExt)

    The libGoogleAnalytics.a indeed does not get copied into the path menioned in the error message. When I build the container iOS app project, the lib file is copied in that build path properly.

    I have the Xamarin.Build.Download (0.2.1) and the Xamarin.Google.iOS.Analytics ( packages in the Keyboard Extension project.

    Updating the Xamarin.Build.Download to the 0.2.2-beta version did not help.

  • fluxmatixfluxmatix FRMember

    Hi @BillHolmes,

    I have the same issues as mentioned in this thread. Tried pretty much all suggested solutions.

    Using Xamarin.Build.Download 0.2.1 (this version gets downloaded with the Google Analytics component version 3.14.07).

    Any developments in this regard?

  • BillHolmesBillHolmes USXamarin Team Xamurai

    @GaborFuredi and @C.S.Hesselink,

    Are you able to build the sample that is provided in the component?

  • GaborFurediGaborFuredi HUMember ✭✭

    @BillHolmes the component is not an issue by itself, as I mentioned in my post if I just import the package to the iOS app itself everything is fine (yes I can build the sample as well). The problem is only with an iOS Keyboard Extension project, not with a single iOS app.

  • BillHolmesBillHolmes USXamarin Team Xamurai


    I have release a new beta for Xamarin.Build.Download

    There is also a new version of Analytics in the release pipeline. I had to make a change to the targets file that is included in the NuGet Package. I expect that the new beta for Analytics will be pushed tomorrow.

    If you want to try the fix before then I suggest that you update Xamarin.Build.Download to the latest beta release. Also you will have to make the same edit to the targets file in the NuGet package for Analytics.

  • BemnetMerhaBemnetMerha USMember ✭✭

    I was getting this error when building my app with admob component. After updating to the beta version of Xamarin.Build.Download i seam to build fine. Can we please get the stable version published?

    /Users/bmerha/OneDrive/Projects/XamarinProjects/RadioApp/TigrinyaRadio.IOS/MTOUCH: Error MT5209: Native linking error: clang: error: no such file or directory: '/Users/bmerha/OneDrive/Projects/XamarinProjects/RadioApp/TigrinyaRadio.IOS/obj/iPhoneSimulator/Release/mtouch-cache/GoogleMobileAds' (MT5209) (TigrinyaRadio.IOS)

  • GaborFurediGaborFuredi HUMember ✭✭

    @BillHolmes confirmed, this works thanks a lot! Will you guys update all the Google packages to include the iOS app extensions now?

  • BillHolmesBillHolmes USXamarin Team Xamurai


    I have pushed the beta.

    I am starting on applying the change to all the Google API projects. Should be released in a few days.

  • GaborFurediGaborFuredi HUMember ✭✭

    @BillHolmes nice, thanks a lot for the quick support!

  • BillHolmesBillHolmes USXamarin Team Xamurai

    I believe that the updated NuGets have been pushed. These should resolve using GoogleAPIsForiOS with iOS extension projects.

  • SupreetTare.9314SupreetTare.9314 GBUniversity ✭✭

    Getting an Object Reference error when trying to use [Firebase Messaging component] & compiling the iOS app. (

    Steps to reproduce:
    1. Create a new xamarin forms app
    2. Build iOS => Ensure it builds successfully
    3. Add the iOS component for Firebase communication from the component store
    4. Clean, Rebuild => Notice you get object reference error

    Here is the error:
    "src\RepeatReturns\packages\Xamarin.Build.Download.0.2.2\build\Xamarin.Build.Download.targets(25,3): error : Object reference not set to an instance of an object."

    Looks like it is related to the issues above. @BillHolmes can you please check & comment if I am correct?


  • BillHolmesBillHolmes USXamarin Team Xamurai

    @SupreetTare.9314, sorry to say I was not able to reproduce with the steps you provided.

  • Kannan.SKannan.S USMember
    edited December 2016

    Native linking error: file not found: -lsqlite3 (MT5209)

    I am getting this error in visual studio(Xamarin ios). While compile the code

    I have tried the following solution some one posted in stack overflow but even it is not working.

    That solution is ->

    Download nuget packages of Xamarin.Build.Download

    To work around the issue you will need to edit the targets file packages/Xamarin.Build.Download.0.2.0/build/Xamarin.Build.Download.targets

    Add a AfterTargets="AssignProjectConfiguration" attribute to the _XamarinBuildDownload target.

    Please help me to solve this issue.. Thanks

  • @SupreetTare.9314, are you using Visual Studio 2017 RC? I had the same issue using it, and I switched to VS2015, and it builds without issues.

    @BillHolmes, can you please check if there is an issue with VS2017 RC?

  • BrendanKehoeBrendanKehoe USMember

    Getting the same issue with VS 2017 RC.

  • dapugdapug USMember ✭✭
    edited February 2017

    Same issue, VS 2017 RC. Native linking error: file not found ...obj/iPhoneSimulator/Debug/mtouch-cache/GoogleMaps

    No problem compiling when NOT connected to Mac, but as soon as Mac agent is connected and I try a build... bam. Dead.

Sign In or Register to comment.