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

Invalid IL in Microsoft.Maui.Handlers.NavigationViewHandler #11258

Closed
cornem opened this issue Nov 10, 2022 · 1 comment
Closed

Invalid IL in Microsoft.Maui.Handlers.NavigationViewHandler #11258

cornem opened this issue Nov 10, 2022 · 1 comment
Labels
platform/android 🤖 t/bug Something isn't working

Comments

@cornem
Copy link

cornem commented Nov 10, 2022

Description

Today I upgraded our app from net6.0-android to net7.0-android. The app works fine in Debug, but fails to start in Release. AOT compilation was already disabled.

Looking at Logcat, I find this error:

android.runtime.JavaProxyThrowable: System.InvalidProgramException: Invalid IL code in Microsoft.Maui.Handlers.NavigationViewHandler:CreatePlatformView (): IL_002a: ldnull

There is a closed issue #7214 with apparently the same error. Looks like that issue got closed without any change to MAUI, but it isn't completely resolved apparently.

Version: maui-android 7.0.49/7.0.100 VS 17.4.33103.184

Steps to Reproduce

Not entirely sure; regression from .NET6.0 without any change to my code.

Link to public reproduction project repository

Internal project

Version with bug

Unknown/Other (please specify)

Last version that worked well

6.0.424

Affected platforms

Android

Affected platform versions

11+

Did you find any workaround?

No response

Relevant log output

android.runtime.JavaProxyThrowable: System.InvalidProgramException: Invalid IL code in Microsoft.Maui.Handlers.NavigationViewHandler:CreatePlatformView (): IL_002a: ldnull
   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()
   at Microsoft.Maui.Handlers.ViewHandler.OnCreatePlatformElement()
   at Microsoft.Maui.Handlers.ElementHandler.CreatePlatformElement()
   at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
   at Microsoft.Maui.Handlers.ViewHandler.SetVirtualView(IElement element)
   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)
   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)
   at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
   at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
   at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
   at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
   at Microsoft.Maui.Platform.ScopedFragment.OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
   at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(IntPtr , IntPtr , IntPtr , IntPtr , IntPtr )
   at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(_JniMarshal_PPLLL_L , IntPtr , IntPtr , IntPtr , IntPtr , IntPtr )
	at crc6452ffdc5b34af3a0f.ScopedFragment.n_onCreateView(Native Method)
	at crc6452ffdc5b34af3a0f.ScopedFragment.onCreateView(ScopedFragment.java:39)
	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3104)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:524)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1890)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1814)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1751)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2976)
	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2886)
	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:351)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1510)
	at android.app.Activity.performStart(Activity.java:8315)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3701)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7898)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
@cornem cornem added the t/bug Something isn't working label Nov 10, 2022
@PureWeen
Copy link
Member

PureWeen commented Nov 10, 2022

Duplicate of dotnet/sdk#28880

@PureWeen PureWeen closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2022
@PureWeen PureWeen marked this as a duplicate of dotnet/sdk#28880 Nov 10, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform/android 🤖 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants