iOS应用程序在启动时从绑定库访问代码时立即关闭

时间:2017-11-20 11:14:00

标签: xamarin xamarin.ios rfid xamarin.ios-binding

我面临一个奇怪的问题。我已将Native框架(Serialio RFID reader)转换为Binding Library并在我的一个示例中使用它。此示例只有一个ViewController。问题是,应用程序在模拟器中启动,但它会立即在真正的iPad设备中关闭,基于我是否写下以下行。

public partial class SViewController : UIViewController
{
    public SViewController (IntPtr handle) : base (handle)
    {
    }

    //If I comment following one line, it launches in the iPad too.
    //If uncomment, app closes immediately after launch.
    //In Simulator this has no issue. It launches.        
    SerialioDeviceManager sdm = SerialioDeviceManager.DefaultManager;

    public override void ViewDidAppear(bool animated)
    {
        base.ViewDidAppear(animated);

        //Even if I comment out above Initialization and write that line here, it doesn't allow app to launch in iPad.
        SerialioDeviceManager sdm = SerialioDeviceManager.DefaultManager;
    }
}

iPad设备日志: enter image description here

更多细节:

  • 即使在调用/初始化ViewController之前,应用程序也已关闭。
  • 这种情况发生在DEBUG以及RELEASE模式。
  • 支持的体系结构为ARMv7 + ARM64
  • 链接器行为:仅限链接框架SDK
  • Native SDK示例运行完美。
  • 此框架在转换时需要iPhoneos10.3 SDK。

修改

只是要更新,我在绑定库中使用以下文件。

enter image description here

我说错了吗?

感谢您的帮助。感谢。

0 个答案:

没有答案