Xamarin 当从绑定库访问代码时,iOS应用程序在启动后立即关闭
我面临一个奇怪的问题。我已将本机框架()转换为绑定库,并在我的一个示例中使用它。此示例只有一个ViewController。问题是,应用程序在模拟器中启动,但在真正的iPad设备中它会立即关闭,这取决于我是否写了下面这行Xamarin 当从绑定库访问代码时,iOS应用程序在启动后立即关闭,xamarin,xamarin.ios,rfid,xamarin.ios-binding,Xamarin,Xamarin.ios,Rfid,Xamarin.ios Binding,我面临一个奇怪的问题。我已将本机框架()转换为绑定库,并在我的一个示例中使用它。此示例只有一个ViewController。问题是,应用程序在模拟器中启动,但在真正的iPad设备中它会立即关闭,这取决于我是否写了下面这行 public partial class SViewController : UIViewController { public SViewController (IntPtr handle) : base (handle) { } //If
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设备日志:
没有更多细节:
- 在调用/初始化此ViewController之前,应用程序已关闭
- 这在
以及DEBUG
模式下发生RELEASE
- 支持的体系结构是
ARMv7+ARM64
- 链接器行为:仅链接框架SDK
- 本机SDK示例运行良好
- 此框架在转换时需要iPhoneos10.3 SDK
我感谢你的帮助。谢谢。您的框架似乎不支持真正的设备,请通过
lipo-info yourlib.a
检查它,这个词是什么意思支持的体系结构是ARMv7+ARM64
,是用于项目还是框架?@ColeXia:感谢您的回复。fat文件中的架构是:armv7 arm64。我提到的是我在Visual Studio for Mac中为示例项目设置的体系结构,iOS构建设置使用绑定库。很奇怪,体系结构armv7+arm64
用于实际设备。。。。但是它在模拟器上工作,而不是在你的ipad上。是的,这很奇怪。我编辑了我的问题,只是为了确保我在框架内使用.a文件的方式是否正确。