rams
rams

Reputation: 6801

How to use AirWatch SDK in a Xamarin (Forms) iOS Project?

AirWatch SDK allows you to include MDM features in your iOS app. I followed the instructions from VMWare's site here.

Unfortunately, after adding the NuGet package to my iOS project, the project fails to compile and throws more than 300 compilation errors of the type

MTOUCH : error MT5211: Native linking failed, undefined Objective-C class: AWWebsiteFilteringPayload. 

The symbol '_OBJC_CLASS_$_AWWebsiteFilteringPayload' could not be found in any of the libraries or frameworks linked with your application.

Upvotes: 1

Views: 308

Answers (1)

rams
rams

Reputation: 6801

The reason for the compilation errors is the Platform (iPhone Simulator vs Device) for which the project is built and the Supported Architectures.

Changing the build option to target a real device gets past the compilation errors.

If you scroll through the build output you will see something like this

ld : warning : ignoring file /Path/To/Your/Project/MyApp.iOS/obj/iPhoneSimulator/Debug/device-builds/iphone10.4-12.1/mtouch-cache/AWSDK.a, missing required architecture x86_64 in file /Path/To/Your/Project/MyApp.iOS/obj/iPhoneSimulator/Debug/device-builds/iphone10.4-12.1/mtouch-cache/AWSDK.a (2 slices)
    Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_AWWebsiteFilteringPayload", referenced from:
         -u command line option 

This Stackoverflow answer helped to discover the architectures targeted in the .a file

In a terminal window enter

lipo -info /Path/To/AWSDK.a

which returns

Architectures in the fat file: AWSDK.a are: armv7 arm64

Now right click on the iOS project and bring up the Options window. Navigate to the "iOS Build" section. The Platform dropdown says "iPhone Simulator". Check the Supported architectures dropdown. You will see i386, x86_64, i386+x86_64 which are not supported in the AWSDK.a file.

Change platform to iPhone and you will see the Armxx options.

Upvotes: 3

Related Questions