-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Description
Description
Our Mono.Android-Tests
project crashes on startup with:
05-05 15:19:34.429 4929 4929 F mono-rt : [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Type provided must be an Enum. Arg_ParamName_Name, enumType
05-05 15:19:34.429 4929 4929 F mono-rt : at System.Enum.InternalGetUnderlyingType(RuntimeType enumType)
05-05 15:19:34.429 4929 4929 F mono-rt : at System.RuntimeType.GetEnumUnderlyingType()
05-05 15:19:34.429 4929 4929 F mono-rt : at System.Enum.GetUnderlyingType(Type enumType)
05-05 15:19:34.429 4929 4929 F mono-rt : at Java.Interop.JniRuntime.JniTypeManager.GetUnderlyingType(Type , Int32& )
05-05 15:19:34.429 4929 4929 F mono-rt : at Java.Interop.JniRuntime.JniTypeManager.GetTypeSignature(Type )
05-05 15:19:34.429 4929 4929 F mono-rt : at Java.Interop.JniPeerMembers.JniInstanceMethods..ctor(Type )
05-05 15:19:34.429 4929 4929 F mono-rt : at Java.Interop.JniPeerMembers.JniInstanceMethods.GetConstructorsForType(Type )
05-05 15:19:34.429 4929 4929 F mono-rt : at Java.Interop.JniPeerMembers.JniInstanceMethods.StartCreateInstance(String , Type , JniArgumentValue* )
05-05 15:19:34.429 4929 4929 F mono-rt : at Java.Lang.Error..ctor(String )
05-05 15:19:34.429 4929 4929 F mono-rt : at Android.Runtime.JavaProxyThrowable..ctor(Exception )
05-05 15:19:34.429 4929 4929 F mono-rt : at Java.Lang.Throwable.FromException(Exception )
05-05 15:19:34.429 4929 4929 F mono-rt : at Android.Runtime.AndroidEnvironment.UnhandledException(Exception e)
05-05 15:19:34.429 4929 4929 F mono-rt : at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPL_V(_JniMarshal_PPL_V , IntPtr , IntPtr , IntPtr )
This looks oddly familiar to a related issue in mono/mono: dotnet/android#1842
Looking at the underlying code, I think it throws here:
Reproduction Steps
Build a .NET 7 Release
app with -p:EnableLLVM=true
.
Expected behavior
Use of -p:EnableLLVM=true
on Android doesn't crash on startup.
Actual behavior
Use of -p:EnableLLVM=true
crashes on startup on Android.
Regression?
This project appears to be working in .NET 6.
Known Workarounds
Disable LLVM.
Configuration
.NET 7.0.100-preview.4.22174.1 c7afae6936bf80239aa93bfd3b6f68513d9876d4
.NET runtime 7.0.0-preview.4.22172.7 c5d40c9
Other information
No response