我已根据文件样本“Xaminals”撰写了一份MAUI数据。 它汇编了罚款,但在安乐器的初始化时,我有以下例外:
Android.Views.InflateException
Message.companyname.shvn_guide:layout/flyoutcontent: Binary XML file Line #1 in com.companyname.shvn_guide:layout/flyoutcontent: Error inflating category com.google.androidmaterial.appbar.AppBarLayout
Stack trace
0xFFFFFFFFFFFFFFFF in Android.Runtime.JNIEnv.monodroid_debugger_unhandled_exception C# 0x1A in Android.Runtime.JNINativeWrapper.unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:12,5 C# 0x1E in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:122,26 C# 0x17 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw C# 0x69 in Java.Interop.JniEnvironment.InstanceMethods.CallObjectMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/obj/Release/net7.0/JniEnvironment.g.cs:11524,5 C# 0x3E in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualObjectMethod at /Users/runner/work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop/Java.Interop/JniPeerMembers.JniInstanceMethods_Invoke.cs:867,7 C# 0x4B in Android.Views.LayoutInflater.Inflate at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net7.0/android-33/mcw/Android.Views.LayoutInflater.cs:661,5 C# 0x2B in Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer.LoadView at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellFlyoutTemplatedContentRenderer.cs:78,4 C# 0x2B in Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutTemplatedContentRenderer..ctor at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellFlyoutTemplatedContentRenderer.cs:60,4 C# 0x1 in Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.CreateShellFlyoutContentRenderer at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellRenderer.cs:144,4 C# 0x1 in Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.Microsoft.Maui.Controls.Platform.Compatibility.IShellContext.CreateShellFlyoutContentRenderer at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellRenderer.cs:49,4 C# 0x1C in Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.AddFlyoutContentToLayoutIfNeeded at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellFlyoutRenderer.cs:249,5 C# 0x68 in Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.AttachFlyout at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellFlyoutRenderer.cs:231,5 C# 0x3 in Microsoft.Maui.Controls.Platform.Compatibility.ShellFlyoutRenderer.Microsoft.Maui.Controls.Platform.Compatibility.IShellFlyoutRenderer.AttachFlyout at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellFlyoutRenderer.cs:64,4 C# 0x55 in Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.OnElementSet at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellRenderer.cs:211,4 C# 0x1B in Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.SetVirtualView at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellRenderer.cs:194,4 C# 0x7 in Microsoft.Maui.Controls.Handlers.Compatibility.ShellRenderer.Microsoft.Maui.IElementHandler.SetVirtualView at D:a_work1ssrcControlssrcCoreCompatibilityHandlersShellAndroidShellRenderer.cs:302,4 C# 0x8B in Microsoft.Maui.Controls.Element.SetHandler at D:a_work1ssrcControlssrcCoreHandlerImplElementElement.Impl.cs:69,6 C# 0x2 in Microsoft.Maui.Controls.Element.set_Handler at D:a_work1ssrcControlssrcCoreHandlerImplElementElement.Impl.cs:19,11 C# 0x18 in Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler at D:a_work1ssrcControlssrcCoreHandlerImplVisualElementVisualElement.Impl.cs:305,5 C# 0xB0 in Microsoft.Maui.Platform.ElementExtensions.ToHandler at D:a_work1ssrcCoresrcPlatformElementExtensions.cs:96,4 C# 0x2 in Microsoft.Maui.Platform.ElementExtensions.ToPlatform at D:a_work1ssrcCoresrcPlatformElementExtensions.cs:127,4 C# 0x5F in Microsoft.Maui.Platform.ContainerView.SetView at D:a_work1ssrcCoresrcPlatformAndroidContainerView.cs:72,5 C# 0x3 in Microsoft.Maui.Platform.ContainerView.set_CurrentView at D:a_work1ssrcCoresrcPlatformAndroidContainerView.cs:51,11 C# 0x8 in Microsoft.Maui.Platform.ElementExtensions.ToContainerView at D:a_work1ssrcCoresrcPlatformAndroidElementExtensions.cs:11,4 C# 0x1F in Microsoft.Maui.Platform.NavigationRootManager.Connect at D:a_work1ssrcCoresrcPlatformAndroidNavigationNavigationRootManager.cs:56,5 C# 0x26 in Microsoft.Maui.Handlers.WindowHandler.CreateRootViewFromContent at D:a_work1ssrcCoresrcHandlersWindowWindowHandler.Android.cs:79,4 C# 0x15 in Microsoft.Maui.Handlers.WindowHandler.MapContent at D:a_work1ssrcCoresrcHandlersWindowWindowHandler.Android.cs:24,4 C# 0x21 in Microsoft.Maui.PropertyMapper<Microsoft.Maui.IWindow,Microsoft.Maui.Handlers.IWindowHandler>. at D:a_work1ssrcCoresrcPropertyMapper.cs:172,6 C# 0x17 in Microsoft.Maui.PropertyMapper.UpdatePropertyCore at D:a_work1ssrcCoresrcPropertyMapper.cs:47,4 C# 0x1D in Microsoft.Maui.PropertyMapper.UpdateProperties at D:a_work1ssrcCoresrcPropertyMapper.cs:82,5 C# 0xCB in Microsoft.Maui.Handlers.ElementHandler.SetVirtualView at D:a_work1ssrcCoresrcHandlersElementElementHandler.cs:79,4 C# 0x8B in Microsoft.Maui.Controls.Element.SetHandler at D:a_work1ssrcControlssrcCoreHandlerImplElementElement.Impl.cs:69,6 C# 0x2 in Microsoft.Maui.Controls.Element.set_Handler at D:a_work1ssrcControlssrcCoreHandlerImplElementElement.Impl.cs:19,11 C# 0xA2 in Microsoft.Maui.Platform.ElementExtensions.SetHandler at D:a_work1ssrcCoresrcPlatformElementExtensions.cs:156,4 C# 0x3 in Microsoft.Maui.Platform.ElementExtensions.SetWindowHandler at D:a_work1ssrcCoresrcPlatformElementExtensions.cs:166,4 C# 0x79 in Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow at D:a_work1ssrcCoresrcPlatformAndroidApplicationExtensions.cs:46,4 C# 0x54 in Microsoft.Maui.MauiAppCompatActivity.OnCreate at D:a_work1ssrcCoresrcPlatformAndroidMauiAppCompatActivity.cs:32,4 C# 0x11 in Android.App.Activity.n_OnCreate_Landroid_os_Bundle at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/obj/Release/net7.0/android-33/mcw/Android.App.Activity.cs:2816,4 C# 0x9 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:121,5 C#
Environment
Windows 10 Pro 19045.3324 16 GB RAM Visual Studio Community Ed. 17.7.3 .NET 7.0 Emulator Pixel 5 API - 33 (Android 13 - API 33)
The error message and stack trace above is all info I get from Visual Studio. I have found no relevant info on Internet. A similar app written for Xamarin did NOT cast this exception. I would appreciate any info on this problem.