Bug 59029 - IOS App of Xamarin Forms app will not compile when Zebra LinkOS is used
Summary: IOS App of Xamarin Forms app will not compile when Zebra LinkOS is used
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 10.99 (xcode9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-08-24 22:21 UTC by Wes Riley
Modified: 2017-08-29 03:46 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Wes Riley 2017-08-24 22:21:00 UTC
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..

Thanks!
Comment 1 Timothy Risi 2017-08-25 20:50:33 UTC
Please include your full build logs, crash reports (if any), test case (to reproduce) and all version information.

To get full build logs just set the log verbosity to diagnostic at the following locations:
- On Visual Studio for Mac: Preferences > Projects > Build
- On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

On Visual Studio Windows you also want to add `-v -v -v -v` to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting `Properties`.
Note: this is done automatically on Visual Studio for Mac when the log verbosity is set to diagnostic.

Easiest way to get exact version information:
- On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.
Then copy/paste the version information (you can use the "Copy Information" button).
Comment 2 Wes Riley 2017-08-25 21:13:26 UTC
Repro Steps Listed in first comment.


Visual Studio Version Info:
*************************************************************
=== Visual Studio Community 2017 for Mac ===

Version 7.1 (build 1297)
Installation UUID: 2bba2b0f-5ae6-4325-ad83-42a2136f08a0
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 4.3.0.2418

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	1.1.1
	1.0.4
SDK: /usr/local/share/dotnet/sdk/1.0.1/Sdks
SDK Version: 1.0.1
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 7.4.0.21 (Visual Studio Community)
Android SDK: /Users/wesleyriley/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.iOS ===

Version: 10.12.0.20 (Visual Studio Community)
Hash: 80b8487d
Branch: d15-3
Build date: 2017-08-18 16:07:26-0400

=== Xamarin.Mac ===

Version: 3.6.0.19 (Visual Studio Community)

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

NuGet Package Explorer 0.1
NuGet Package Management Extensions 0.12.1
Redth's Addins 1.0.9

Verbose Build Logs:
*************************************************************

Build FAILED.

/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2001,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2001,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.
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
    2 Warning(s)
    2 Error(s)

Time Elapsed 00:00:33.66

---------------------- Done ----------------------
Comment 3 Wes Riley 2017-08-29 03:46:23 UTC
Bug exists in Zebra product.