Skip to content

.NET RC 2: EnableLLVM=true causes exception in MAUI app on Android #77319

@jonathanpeppers

Description

@jonathanpeppers

Description

Running on a Pixel 5, I get this for a dotnet new maui project:

10-21 09:29:08.341 10012 10012 E AndroidRuntime: Process: com.companyname.hellomaui, PID: 10012
10-21 09:29:08.341 10012 10012 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.PlatformNotSupportedException: Arg_PlatformNotSupported
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at System.String.MakeSeparatorListVectorized(ValueListBuilder`1& , Char , Char , Char )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at System.String.MakeSeparatorList(ReadOnlySpan`1 , ValueListBuilder`1& )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at System.String.SplitInternal(ReadOnlySpan`1 , Int32 , StringSplitOptions )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at System.String.Split(Char[] )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.Controls.BindingExpression.ParsePath()
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.Controls.BindingExpression..ctor(BindingBase binding, String path)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.Controls.Binding.set_Path(String value)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.Controls.Binding..ctor(String path, BindingMode mode, IValueConverter converter, Object converterParameter, String stringFormat, Object source)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.Controls.ShellItem.CreateFromShellSection(ShellSection shellSection)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.Controls.ShellItem.op_Implicit(ShellSection shellSection)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.Controls.ShellItem.op_Implicit(ShellContent shellContent)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at HelloMaui.AppShell.InitializeComponent()
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at HelloMaui.App..ctor()
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags , Binder , Object[] , CultureInfo )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite , RuntimeResolverContext )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSiteMain(ServiceCallSite , RuntimeResolverContext )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite , RuntimeResolverContext )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.RuntimeResolverContext, Microsoft.Extensions.DependencyInjection, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].VisitCallSite(ServiceCallSite , RuntimeResolverContext )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(Type )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at System.Collections.Concurrent.ConcurrentDictionary`2[[System.Type, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Func`2[[Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope, Microsoft.Extensions.DependencyInjection, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60],[System.Object, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetOrAdd(Type , Func`2 )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type , ServiceProviderEngineScope )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService(Type serviceType)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.MauiContext.WrappedServiceProvider.GetService(Type serviceType)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider , Type )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[IApplication](IServiceProvider )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Microsoft.Maui.MauiApplication.OnCreate()
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Android.App.Application.n_OnCreate(IntPtr , IntPtr )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:    at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V(_JniMarshal_PP_V , IntPtr , IntPtr )
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at crc6488302ad6e9e4df1a.MauiApplication.n_onCreate(Native Method)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at crc6488302ad6e9e4df1a.MauiApplication.onCreate(MauiApplication.java:28)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1266)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6785)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2134)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7898)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
10-21 09:29:08.341 10012 10012 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

This looks similar to #73003, but the stack trace is different.

Reproduction Steps

  • dotnet new maui
  • Build and run with: dotnet build -c Release -f net6.0-android -p:EnableLLVM=true -t:Run

Some apps are working with this combination, but the dotnet new maui template does not.

Expected behavior

I shouldn't get an exception when using EnableLLVM=true

Actual behavior

I get an exception when using EnableLLVM=true

Regression?

I believe the dotnet new maui template runs in .NET 6 with this combination.

Known Workarounds

Don't use -p:EnableLLVM=true.

Configuration

Using .NET SDK 7.0.100-rc.2.22477.23
Runtime version is 7.0.0-rc.2.22472.3

Other information

Here is an .apk:

com.companyname.hellomaui-Signed.apk.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions