7 Replies Latest reply on Sep 1, 2017 9:34 AM by Robin West

    Brand New Xamarin Forms App Linking Issues

    Wesley Riley

      Brand new Xamarin Forms application with iOS platform project. Added LinkOS_Xamarin_SDK in forms project and iOS project (v1.1.75). Placed the following code in one of my page code behind:

       

      sing System.Threading.Tasks;

      using System.Text;

      using System.Diagnostics;

      using System;

      using Xamarin.Forms;

      using LinkOS.Plugin.Abstractions;

      using LinkOS.Plugin;

       

       

      namespace Printer

      {

        public partial class PrinterPage : ContentPage

        {

        public PrinterPage()

        {

        InitializeComponent();

        }

       

        void Handle_Clicked(object sender, System.EventArgs e)

        {

      Task.Run(async () =>

      {

      await Task.Delay(100);

      var address = "AC:3F:A4:5B:1E:7E";

      Print(address);

      });

        }

       

      IConnection connection;

       

      private void Print(string address)

      {

      string zpl = "^XA^LL200^FO30,20^A0N,30,30^FDHello World^FS^XZ";

       

      try

      {

      if ((connection == null) || (!connection.IsConnected))

      {

      connection = ConnectionBuilder.Current.Build("BT:" + address);

      connection.Open();

      }

       

      }

      catch (Exception e)

      {

      //if the device is unable to connect, an exception is thrown

      Debug.WriteLine(e.ToString());

      }

      }

        }

      }

       

      When the application compiles against a real device in debug mode the following errors are thrown:

       

      "_CGImageGetWidth", referenced from:

        -[GraphicsUtilCpcl printImage:atX:atY:withWidth:withHeight:andIsInsideFormat:error:] in libZSDK_API.a(GraphicsUtilCpcl.o)

        -[GraphicsUtilCpcl storeImage:withImage:withWidth:andWithHeight:error:] in libZSDK_API.a(GraphicsUtilCpcl.o)

        -[GraphicsUtilZpl printImage:atX:atY:withWidth:withHeight:andIsInsideFormat:error:] in libZSDK_API.a(GraphicsUtilZpl.o)

        -[GraphicsUtilZpl storeImage:withImage:withWidth:andWithHeight:error:] in libZSDK_API.a(GraphicsUtilZpl.o)

        "_OBJC_CLASS_$_EAAccessoryManager", referenced from:

        objc-class-ref in libZSDK_API.a(MfiBtPrinterConnection.o)

        "_OBJC_CLASS_$_EASession", referenced from:

        objc-class-ref in libZSDK_API.a(Zebra_EADSessionController.o)

        ld: symbol(s) not found for architecture arm64

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

        

        MTOUCH : error MT5216: Native linking failed for '/Users/wesleyriley/Projects/InventoryManager/InventoryManager/InventoryManager.iOS/obj/iPhone/Debug/device-builds/ipad6.7-10.0.1/mtouch-cache/arm64/libzsdk_iosx.dll.dylib'. Please file a bug report at http://bugzilla.xamarin.com

      Done building target "_CompileToNative" in project "InventoryManager.iOS.csproj" -- FAILED.

       

      Done building project "InventoryManager.iOS.csproj" -- FAILED.

       

      Build FAILED.

      ...

      ...

      ...

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

      MTOUCH : error MT5216: Native linking failed for '/Users/wesleyriley/Projects/InventoryManager/InventoryManager/InventoryManager.iOS/obj/iPhone/Debug/device-builds/ipad6.7-10.0.1/mtouch-cache/arm64/libzsdk_iosx.dll.dylib'. Please file a bug report at http://bugzilla.xamarin.com

       

      Note this error does not happen when running on a simulator. Unfortunately, I need a real device to test Bluetooth Zebra printing..

       

      I am running the latest version of Xamarin and the latest version of Visual Studio. I have tried this in Visual Studio 2017 for Windows and VS 2017 for MAC with the same result.

       

      Any help would be greatly appreciated.