Xamarin Mac 应用程序因错误而崩溃 Xamarin.Forms.Platform.MacOS.LayoutRenderer' 没有采用一个 IntPtr 参数的构造函数

如何解决Xamarin Mac 应用程序因错误而崩溃 Xamarin.Forms.Platform.MacOS.LayoutRenderer' 没有采用一个 IntPtr 参数的构造函数

Xamarin 应用程序因错误而崩溃 Xamarin.Forms.Platform.MacOS.LayoutRenderer' 没有采用一个 IntPtr 参数的构造函数

如果我们在 Mac Book 中安装 Visual Studio,应用程序就可以正常工作。如果我们卸载visual studio,它会再次崩溃。绕线我是否遗漏了任何设置。

详细的错误日志如下:

消息:---无法封送 Objective-C 对象 0x7feb16e40d90(类型:Xamarin_Forms_Platform_MacOS_LayoutRenderer)。找不到此对象的现有托管实例,也无法创建新的托管实例(因为“Xamarin.Forms.Platform.MacOS.LayoutRenderer”类型没有采用一个 IntPtr 参数的构造函数)。 内部异常:-- 堆栈跟踪:-- 在 ObjCRuntime.Runtime.MissingCtor(system.intPtr ptr、system.intPtr klass、System.Type 类型、ObjCRuntime.Runtime+MissingCtorResolution 分辨率)[0x00074] 在 在 ObjCRuntime.Runtime.ConstructNSObject[T] (system.intPtr ptr,System.Type type,ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution) [0x0002a] 在 在 ObjCRuntime.Runtime.GetINativeObject[T] (system.intPtr ptr,System.Boolean force_type,System.Boolean owns) [0x00146] 在 :0 在 ObjCRuntime.Runtime.GetINativeObject[T] (system.intPtr ptr,System.Boolean owns) [0x00001] 在 :0 在 Foundation.NSArray.UnsafeGetItem[T](system.intPtr 句柄,System.nuint 索引)[0x00029] 在 :0 在 Foundation.NSArray.ArrayFromHandle[T] (system.intPtr 句柄) [0x00039] 在 :0 在 AppKit.NSView.get_Subviews () [0x00038] 在 :0 在 AppKit.NSView.RemoveFromSuperview () [0x00045] 在 :0 在 Xamarin.Forms.Platform.MacOS.VisualElementPackager.OnChildRemoved(Xamarin.Forms.VisualElement 视图)[0x00019] 在 :0 在 Xamarin.Forms.Platform.MacOS.VisualElementPackager.SetElement (Xamarin.Forms.VisualElement oldElement,Xamarin.Forms.VisualElement newElement) [0x00060] 在 :0 在 Xamarin.Forms.Platform.MacOS.VisualElementPackager.dispose (System.Boolean disposing) [0x0005c] 在 :0 在 Xamarin.Forms.Platform.MacOS.VisualElementPackager.dispose () [0x00000] 在 :0 在 Xamarin.Forms.Platform.MacOS.VisualElementRenderer`1[TElement].dispose (System.Boolean disposing) [0x00058] 在 :0 在 Foundation.NSObject.dispose () [0x00001] 在 :0 在 Xamarin.Forms.Platform.MacOS.VisualElementPackager.dispose (System.Boolean disposing) [0x0003f] 在 :0 在 Xamarin.Forms.Platform.MacOS.VisualElementPackager.dispose () [0x00000] 在 :0 在 Xamarin.Forms.Platform.MacOS.PageRenderer.dispose (System.Boolean disposing) [0x00071] 在 :0 在 Foundation.NSObject.dispose () [0x00001] 在 :0 在 Xamarin.Forms.Platform.MacOS.disposeHelpers.disposeModalAndChildRenderers(Xamarin.Forms.Element 视图)[0x00042] 在 :0 在 Xamarin.Forms.Platform.MacOS.Platform.System.Idisposable.dispose () [0x0004e] 在 :0 在 Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.UpdateMainPage () [0x00049] 在 :0 在 Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.ApplicationOnPropertyChanged (System.Object sender,System.ComponentModel.PropertyChangedEventArgs e) [0x00012] 在 :0 在 Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] 在 :0 在 Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] 在 :0 在 Xamarin.Forms.Application.set_MainPage(Xamarin.Forms.Page 值)[0x0008b] 在 :0 在 Avrio.viewmodels.DatasetInfoviewmodelForMacOS.BackToList () [0x0001a] 在 :0 在 Avrio.viewmodels.DatasetInfoviewmodelForMacOS.<.ctor>b__155_14 () [0x00000] 在 :0 在 Xamarin.Forms.Command+c__displayClass4_0.<.ctor>b__0 (System.Object o) [0x00000] 在 :0 在 Xamarin.Forms.Command.Execute(System.Object 参数)[0x00000] 在 :0 在 Xamarin.Forms.ButtonElement.ElementClicked (Xamarin.Forms.VisualElement visualElement,Xamarin.Forms.Internals.IButtonElement ButtonElementManager) [0x0001a] 在 :0 在 Xamarin.Forms.Button.SendClicked () [0x00000] 在 :0 在 Xamarin.Forms.Platform.MacOS.ButtonRenderer.OnButtonActivated (System.Object sender,System.EventArgs eventArgs) [0x0000a] 在 :0 在 AppKit.Actiondispatcher.OnActivated (Foundation.NSObject sender) [0x00010] 在 :0 at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr(intptr,intptr,intptr) 在 AppKit.NSControl.MouseDown (AppKit.NSEvent theEvent) [0x0004d] 在 :0 在 Xamarin.Forms.Platform.MacOS.ButtonRenderer+FormsNSButton.MouseDown (AppKit.NSEvent theEvent) [0x00011] 在 :0 at (wrapper managed-to-native) AppKit.NSApplication.NSApplicationMain(int,string[]) 在 AppKit.NSApplication.Main (System.String[] args) [0x00040] 在 :0 在 Avrio.MAC.MainClass.Main (System.String[] args) [0x00014] 在 :0

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?