【问题标题】:How to use AirWatch SDK in a Xamarin (Forms) iOS Project?如何在 Xamarin (Forms) iOS 项目中使用 AirWatch SDK?
【发布时间】:2019-01-08 16:46:03
【问题描述】:

AirWatch SDK 允许您在 iOS 应用程序中包含 MDM 功能。我按照 VMWare 网站 here 的说明进行操作。

很遗憾,在我的iOS项目中添加NuGet包后,项目编译失败,抛出300多个类型的编译错误

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

找不到符号“_OBJC_CLASS_$_AWWebsiteFilteringPayload” 在与您的应用程序链接的任何库或框架中。

【问题讨论】:

    标签: xamarin xamarin.forms xamarin.ios airwatch


    【解决方案1】:

    编译错误的原因是构建项目的平台(iPhone 模拟器与设备)和支持的架构。

    将构建选项更改为以真实设备为目标可以克服编译错误。

    如果您滚动浏览构建输出,您将看到类似这样的内容

    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 的回答有助于发现 .a 文件中的目标架构

    在终端窗口输入

    lipo -info /Path/To/AWSDK.a
    

    返回

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

    现在右键单击 iOS 项目并打开选项窗口。导航到“iOS 构建”部分。平台下拉菜单显示“iPhone 模拟器”。检查支持的架构下拉菜单。您将看到 AWSDK.a 文件中不支持的 i386、x86_64、i386+x86_64。

    将平台更改为 iPhone,您将看到 Armxx 选项。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多