System.InvalidProgramException: 'Invalid IL code in Mono.SystemDependencyProvider:Initialize (): IL_002e: endfinally '

Vuyiswa Maseko 351 Reputation points
2022-05-03T09:11:24.967+00:00

Good Day All

When am in debug mode my Xamarin Android App does not run on the emulator and also on the device , it crashes with the following error

but on Release it does run on the device. i have disabled "fast deployment" already

The last part of the output window gives me this

Loaded assembly: Java.Interop.dll [External]
Resolved pending breakpoint for 'Android.Runtime.JNIEnv.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/builder/azdo/_work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnv.cs:124 [0x00000].
Loaded assembly: System.dll [External]
**System.InvalidProgramException:
'Invalid IL code in Mono.SystemDependencyProvider:Initialize (): IL_002e: endfinally**

on top i have also these entries

[monodroid-assembly] Assembly 'Xamarin.Android.Arch.Core.Common.dll' (hash 0x9917bf1) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Arch.Core.Common.dll\
[monodroid-assembly] Assembly 'Xamarin.Android.Arch.Core.Runtime.dll' (hash 0xc093538) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Arch.Core.Runtime.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Arch.Lifecycle.Common.dll' (hash 0xb6e8e036) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Arch.Lifecycle.Common.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Arch.Lifecycle.LiveData.Core.dll' (hash 0x4d54f66a) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Arch.Lifecycle.LiveData.Core.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Arch.Lifecycle.LiveData.dll' (hash 0xa0d44932) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Arch.Lifecycle.LiveData.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Arch.Lifecycle.Runtime.dll' (hash 0xe6f63edd) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Arch.Lifecycle.Runtime.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Arch.Lifecycle.ViewModel.dll' (hash 0x4174b615) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Arch.Lifecycle.ViewModel.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Support.Annotations.dll' (hash 0x2949a4b6) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Support.Annotations.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Support.AsyncLayoutInflater.dll' (hash 0xbf0715d1) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Support.AsyncLayoutInflater.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Support.Collections.dll' (hash 0xa406a881) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Support.Collections.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Support.Compat.dll' (hash 0x1ead1551) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Support.Compat.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Support.CoordinaterLayout.dll' (hash 0xc7d59168) not found
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Android.Support.CoordinaterLayout.dll
[monodroid-assembly] Assembly 'Xamarin.Android.Support.Core.UI.dll' (hash 0x173e7f54) not found

i am using Androidx , i assume that i dont need to have these as long as corresponding AndroidX nuggets are installed.

Thanks

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,326 questions
{count} votes