我在Core和iOS项目中安装了Mvvmcross color插件的3.5.1版本。当我启动应用程序时,该应用程序崩溃并显示错误:

Cirrious.CrossCore.Exceptions.MvxException:找不到类型为Cirrious.MvvmCross.Plugins.Color.Touch.Plugin的默认构造函数---> System.MissingMethodException:找不到类型为Cirrious.MvvmCross.Plugins.Color.Touch.Plugin的默认构造函数
  在/Users/builder/data/lanes/2356/3c0ec355/source/maccore/_build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/src/mono中的System.RuntimeType.CreateInstanceMono(布尔非公共)[0x00085] /mcs/class/corlib/ReferenceSources/RuntimeType.cs:105
  在/ Users / builder / data / lanes / 2356 / 3c0ec355 / source / maccore / _build / Library / Frameworks /中的System.RuntimeType.CreateInstanceSlow(布尔publicOnly,布尔skipCheckThis,布尔fillCache,System.Threading.StackCrawlMark和stackMark)[0x0001a]中Xamarin.iOS.framework / Versions / git / src / mono / mcs / class / corlib / ReferenceSources / RuntimeType.cs:87
  在/ Users / builder / data / lanes / 2356 / 3c0ec355 / source / maccore / _build / Library / Frameworks /中的System.RuntimeType.CreateInstanceDefaultCtor(布尔publicOnly,布尔skipCheckThis,布尔fillCache,System.Threading.StackCrawlMark和stackMark)[0x0002a]中Xamarin.iOS.framework / Versions / git / src / mono / external / referencesource / mscorlib / system / rttype.cs:5734
  在System.Activator.CreateInstance [T]()中:: 0
  在Cirrious.CrossCore.Plugins.MvxLoaderPluginBootstrapAction 2[TPlugin,TPlatformPlugin].<PreLoad>b__0 () [0x00000] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxLoaderPluginManager.FindPlugin (System.Type toLoad) [0x0004d] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxPluginManager.ExceptionWrappedLoadPlugin (System.Type toLoad) [0x00000] in <filename unknown>:0 --- End of inner exception stack trace --- at Cirrious.CrossCore.Plugins.MvxPluginManager.ExceptionWrappedLoadPlugin (System.Type toLoad) [0x00040] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePlatformAdaptionLoaded[T] () [0x00021] in <filename unknown>:0 at Cirrious.MvvmCross.Plugins.Color.PluginLoader.EnsureLoaded () [0x00006] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePluginLoaded (IMvxPluginLoader pluginLoader) [0x0005e] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePluginLoaded (System.Type type) [0x0007f] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxPluginManager.EnsurePluginLoaded[TType] () [0x00000] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxPluginBootstrapAction 1 [TPlugin] .Load(IMvxPluginManager管理器)[0x00000]中的位置:: 0
  在Cirrious.CrossCore.Plugins.MvxLoaderPluginBootstrapAction 2[TPlugin,TPlatformPlugin].Load (IMvxPluginManager manager) [0x00007] in <filename unknown>:0 at Cirrious.CrossCore.Plugins.MvxPluginBootstrapAction 1 [TPlugin] .RunAction()[0x00006] in:0中
  在0的Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.InternalSetResolver(System.Type tInterface,IResolver解析器)[0x0005c]中
  在Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.RegisterSingleton(System.Type tInterface,System.Object theObject)中:[0x00008],在:0中
  在Cirrious.CrossCore.IoC.MvxSimpleIoCContainer.RegisterSingleton [TInterface](Cirrious.CrossCore.IoC.TInterface theObject)[0x00000]在:0中
  在Cirrious.CrossCore.Mvx.RegisterSingleton [TInterface](Cirrious.CrossCore.TInterface服务)中的[0x00006] :: 0
  在Cirrious.MvvmCross.Platform.MvxSetup.InitializePluginFramework()[0x0001a]中的位置:: 0
  在Cirrious.MvvmCross.Platform.MvxSetup.InitializeSecondary()[0x00068]中的位置:: 0
  在Cirrious.MvvmCross.Platform.MvxSetup.Initialize()[0x00006] in:0
  在/Users/edward.price/Development/source/client/Orderpad.Android/Orderpad.iOS/AppDelegate.cs:32中的Orderpad.iOS.AppDelegate.FinishedLaunching(UIKit.UIApplication应用程序,Foundation.NSDictionary launchOptions)[0x00024]
  在(包装器托管到本机)UIKit.UIApplication:UIApplicationMain(int,string [],intptr,intptr)
  在/Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIApplication.cs:77中的UIKit.UIApplication.Main(System.String [] args,IntPtr主体,IntPtr委托)[0x00005]
  在/ Users / builder / data / lanes / 2356 / 3c0ec355 / source / maccore / src / UIKit / UIApplication中的UIKit.UIApplication.Main(System.String [] args,System.StringPrincipalClassName,System.String proxyClassName)[0x0001c]中.cs:60
  在/Users/edward.price/Development/source/client/Orderpad.Android/Orderpad.iOS/Main.cs:12中的Orderpad.iOS.Application.Main(System.String [] args)[0x00008]

它在setup.Initialize();中失败。

    public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
    {
        _window = new UIWindow(UIScreen.MainScreen.Bounds);

        var setup = new Setup(this, _window);
        setup.Initialize();

        ApplyTheme();

        var startup = Mvx.Resolve<IMvxAppStart>();
        startup.Start();

        _window.MakeKeyAndVisible();

        return true;
    }


最后一个Mvx调试跟踪是:

确保为Cirrious.MvvmCross.Plugins.Color.PluginLoader加载了插件

任何想法出了什么问题?

最佳答案

通过添加解决:

<assembly fullname="Cirrious.MvvmCross.Plugins.Color.Touch">
      <type fullname="*" />
</assembly>


到Linker.xml

08-26 03:45