xamarin - Resolution failed exception in Xamarin IOS prism
问题描述
I have an iOS application written in Xamarin and I am getting a Unity Exceptions Resolution Failed exception when I try and run the application in iOS. However this error does not happen when I run the android version of the application. The exception is being thrown while the initalize function from prism is taking place.
Here is a snippet from my app.xaml.cs
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
this.RegisterLocal(containerRegistry);
this.RegisterServices(containerRegistry);
this.RegisterPagesForNavigation(containerRegistry);
}
This code all executes and passes.
This is the iOS initialization
Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
PullToRefreshLayoutRenderer.Init();
LoadApplication(new App(new IosInitializer()));
return base.FinishedLaunching(app, options);
}
public class IosInitializer : IPlatformInitializer
{
public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.Register<IUAirshipUpdate, UAirshipUpdate>();
}
}
This code also executes
The exception being thrown is an argument null exception indicating that IModuleCatelog is not present. I do not understand why it is looking for that module and can not find it. The source code on GitHub indicates that class was registered.
解决方案
导致此问题的原因是 IOS 应用程序的链接器行为设置为完整,这会导致 Unity IOC 容器出现问题。
推荐阅读
- ios - 快速从 API 调用传递 json 数组的所有成员
- angularjs - 带有 templateUrl 业力错误的指令
- python - Itertools 组合/排列大小
- android - 如何将带有片段的 ViewPager 添加到 Android 中的 EditText 自动完成建议视图?
- aurelia - Aurelia 动画未启动
- vmware-workstation - 在带有 GPU 的 Windows 10 VMWare 主机上运行 Linux 来宾
- javascript - 多个带有 flickity 灯箱的画廊
- php - 在 laravel 中查看共享所有设置表是一种好习惯吗?
- swift - Sprite 工具包滚动背景中的静态节点
- mercurial - 让 Mercurial 回购拒绝任何会导致多头分支的推送