Empty NavigationPageRenderer crashes the app
Description
Simply using an empty NavigationPageRenderer will crash the app
Steps to Reproduce
public class MyNavigationPageRenderer : NavigationPageRenderer
{
public MyNavigationPageRenderer(Context context) : base(context) {}
}
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCompatibility()
.ConfigureMauiHandlers((handlers) => handlers.AddCompatibilityRenderer(typeof(NavigationPage), typeof(MyNavigationPageRenderer)));
Expected results: App starts
Actual results:
System.MissingMethodException: 'Method not found: int .Layout.get_toolbar()'
in Android.Runtime.RuntimeNativeMethods.monodroid_debugger_unhandled_exception in Android.Runtime.JNINativeWrapper._unhandled_exception at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:13,5 in Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L at /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNINativeWrapper.g.cs:368,26 in Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat.NavigationPageRenderer.SetupToolbar in Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat.NavigationPageRenderer.OnElementChanged in Microsoft.Maui.Controls.Compatibility.Platform.Android.VisualElementRenderer<Microsoft.Maui.Controls.NavigationPage>.SetElement in Microsoft.Maui.Controls.Compatibility.Platform.Android.VisualElementRenderer<Microsoft.Maui.Controls.NavigationPage>.Microsoft.Maui.Controls.Compatibility.Platform.Android.IVisualElementRenderer.SetElement in Microsoft.Maui.Controls.Compatibility.RendererToHandlerShim.SetVirtualView in Microsoft.Maui.Handlers.ViewHandler<Microsoft.Maui.IView,Android.Views.View>.SetVirtualView at D:\a_work\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:56,4 ...
Link to public reproduction project repository
No response
Version with bug
8.0.7 SR2
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Nope. I'm still trying to figure out how to implement the equivalent functionality using handlers.
Relevant log output
No response
Has anyone figure this out? I'm having the same problem.
Uh, no. A repro was provided. The "needs repro" tag is incorrect.
Please, please, have a look at this. We are stuck with our XF->MAUI migration :-(
Will there be any reaction from the developers? Do you follow the same rule as it was with Xamarin: "If we can't fix something, we keep quiet about it"????
look like the repro was deleted
look like the repro was deleted
It was not. It's under "steps to reproduce".
It's also trivial to reproduce just from the description, because it's an entire, major feature that literally does not work at all. This bug report is not "there is an edge case that does not work", it's "this feature never works, even in the simplest, most trivial case."
@BlueRaja repro, is a runnable project that reproduces the issue. Friendly asking... If it's trivial why not provide it and help us to help you?
BTW, I'm a community contributor and don't work for maui team