Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release configuration crash on Android (Invalid IL code, NavigationViewHandler) #7367

Closed
Michal-MK opened this issue May 20, 2022 · 2 comments
Labels
platform/android 🤖 s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working

Comments

@Michal-MK
Copy link

Description

In Debug Configuration my application runs fine, when I switch to Release Configuration I do not get past the splah screen.

Steps to Reproduce

If it ends up being necessary I will provide the full application. But from the logcat output it seems that the issue is generic...?

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

No :/

Relevant log output

05-20 16:27:45.067 22646 22646 E AndroidRuntime: FATAL EXCEPTION: main
05-20 16:27:45.067 22646 22646 E AndroidRuntime: Process: com.companyname.erecept_maui, PID: 22646
05-20 16:27:45.067 22646 22646 E AndroidRuntime: android.runtime.JavaProxyThrowable: Microsoft.Maui.Platform.ToPlatformException: Microsoft.Maui.Handlers.NavigationViewHandler found for Microsoft.Maui.Controls.NavigationPage is incompatible
05-20 16:27:45.067 22646 22646 E AndroidRuntime:  ---> System.InvalidProgramException: Invalid IL code in Microsoft.Maui.Handlers.NavigationViewHandler:CreatePlatformView (): IL_002a: ldnull    
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IStackNavigationView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Android.Views.View, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]].OnCreatePlatformView()
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ViewHandler.OnCreatePlatformElement()
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ElementHandler.CreatePlatformElement()
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ViewHandler.SetVirtualView(IElement element)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IStackNavigationView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Android.Views.View, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]].SetVirtualView(IView view)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IStackNavigationView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Android.Views.View, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065]].SetVirtualView(IElement view)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    Exception_EndOfInnerExceptionStack
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ContainerView.SetView(IElement view, Boolean forceRefresh)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ContainerView.set_CurrentView(IElement value)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ElementExtensions.ToContainerView(IElement view, IMauiContext context)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.NavigationRootManager.Connect(IView view, IMauiContext mauiContext)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.WindowHandler.MapContent(IWindowHandler handler, IWindow window)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Microsoft.Maui.IWindow, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Handlers.IWindowHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ElementExtensions.SetHandler(Context nativeElement, IElement element, IMauiContext context)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ElementExtensions.SetWindowHandler(Activity platformWindow, IWindow window, IMauiContext context)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.Platform.ApplicationExtensions.CreatePlatformWindow(Activity activity, IApplication application, Bundle savedInstanceState)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Microsoft.Maui.MauiAppCompatActivity.OnCreate(Bundle savedInstanceState)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at ERecept.MAUI.MainActivity.OnCreate(Bundle savedInstanceState)
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_(IntPtr , IntPtr , IntPtr )
05-20 16:27:45.067 22646 22646 E AndroidRuntime:    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V , IntPtr , IntPtr , IntPtr )
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at crc64bdc867510ab3314c.MainActivity.n_onCreate(Native Method)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at crc64bdc867510ab3314c.MainActivity.onCreate(MainActivity.java:38)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:8019)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:8003)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3445)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3636)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2084)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:223)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7888)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
05-20 16:27:45.067 22646 22646 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981)
@Michal-MK Michal-MK added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels May 20, 2022
@Michal-MK Michal-MK changed the title Release configuration crashses on android Release configuration crash on Android (Invalid IL code, NavigationViewHandler) May 20, 2022
@Michal-MK
Copy link
Author

I created a sample project by simply deleting the shell and replacing App.xaml.cs:9 with MainPage = new NavigationPage();
Repo. Link Debug works, Release crashes.

@Michal-MK
Copy link
Author

OK actually a duplicate of #7214

@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/android 🤖 s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants