I have a .Net Maui v9 app that I have developed and the app woks fine when I deploy it to my test device and debug it, but when I exit the debugger and try to run the app standalone the splash screen appears for a second and then the app crashes with no errors. In the early stages of development, that wasn't happening. In debug the app runs fine, all functions are executed with no errors and there are zero errors and zero warning displayed in Visual Studio.
I thought maybe it was a debug only issue so I made the project into a release and then the fun began. The properties screen refused to accept any data entry for the keystore file, as soon as I left the field the text box blanked out immediately. I reported the debug issue to Microsoft here and I have not found a workaround for it.
The release issue I reported here and was able to find a workaround to the keystore text field problem which I and others documented in the comments. However the release version has the same problem, the splash screen appears for a second and then the app crashes with no errors.
Microsoft has yet to respond. The apps I'm working on have been blocked for release updates on Google and the Play Store due to the fact that they don't target the latest versions of Android and iOS and at some point soon will be removed entirely.
I've tried all suggestions for a fix I've found on Stack Overflow and other sites, but nothing has worked.
I've tried restoring Nuget packages, removing unused references, reordered entries in the .csproj file, setting AOT to false in the .csproj file. Nothing has worked.
I'm using Visual Studio Version 17.12.5 which as of this post is the latest release which just came out about two days ago. Does anyone know of a resolution?
I pulled the following from my device logs:
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: Process: oml.MyApplication.manager, PID: 14606
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: android.runtime.JavaProxyThrowable: [Microsoft.Maui.Controls.Xaml.XamlParseException]: Position 22:24. StaticResource not found for key NavigationBarColor
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.Xaml.StaticResourceExtension.ProvideValue + 0xad(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at MyApplication.MainPage.InitializeComponent + 0x3e8(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at MyApplication.MainPage..ctor + 0x25(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Unknown.Unknown(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InterpretedInvoke + 0x0(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InvokeDirectByRefWithFewArgs + 0x7d(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InvokeDirectByRef + 0x29(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InvokeImpl + 0xbe(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.Invoke + 0x47(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ConstructorMatcher.CreateInstance + 0xc8(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance + 0x1d7(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.ShellContent+<>c__DisplayClass20_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0 + 0x68(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.ElementTemplate.CreateContent + 0x27(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent + 0x8(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent + 0x69(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView + 0x16e(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ + 0x20(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L + 0x5(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:41)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3119)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:577)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2214)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2115)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2052)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3327)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:3230)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3153)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:608)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2214)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2115)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2052)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3327)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3237)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1582)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.Activity.performStart(Activity.java:9034)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4206)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:225)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:205)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:177)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2693)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:230)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.os.Looper.loop(Looper.java:319)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:9063)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
I have a .Net Maui v9 app that I have developed and the app woks fine when I deploy it to my test device and debug it, but when I exit the debugger and try to run the app standalone the splash screen appears for a second and then the app crashes with no errors. In the early stages of development, that wasn't happening. In debug the app runs fine, all functions are executed with no errors and there are zero errors and zero warning displayed in Visual Studio.
I thought maybe it was a debug only issue so I made the project into a release and then the fun began. The properties screen refused to accept any data entry for the keystore file, as soon as I left the field the text box blanked out immediately. I reported the debug issue to Microsoft here and I have not found a workaround for it.
The release issue I reported here and was able to find a workaround to the keystore text field problem which I and others documented in the comments. However the release version has the same problem, the splash screen appears for a second and then the app crashes with no errors.
Microsoft has yet to respond. The apps I'm working on have been blocked for release updates on Google and the Play Store due to the fact that they don't target the latest versions of Android and iOS and at some point soon will be removed entirely.
I've tried all suggestions for a fix I've found on Stack Overflow and other sites, but nothing has worked.
I've tried restoring Nuget packages, removing unused references, reordered entries in the .csproj file, setting AOT to false in the .csproj file. Nothing has worked.
I'm using Visual Studio Version 17.12.5 which as of this post is the latest release which just came out about two days ago. Does anyone know of a resolution?
I pulled the following from my device logs:
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: Process: oml.MyApplication.manager, PID: 14606
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: android.runtime.JavaProxyThrowable: [Microsoft.Maui.Controls.Xaml.XamlParseException]: Position 22:24. StaticResource not found for key NavigationBarColor
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.Xaml.StaticResourceExtension.ProvideValue + 0xad(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at MyApplication.MainPage.InitializeComponent + 0x3e8(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at MyApplication.MainPage..ctor + 0x25(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Unknown.Unknown(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InterpretedInvoke + 0x0(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InvokeDirectByRefWithFewArgs + 0x7d(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InvokeDirectByRef + 0x29(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.InvokeImpl + 0xbe(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at System.Reflection.ConstructorInvoker.Invoke + 0x47(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ConstructorMatcher.CreateInstance + 0xc8(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance + 0x1d7(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.ShellContent+<>c__DisplayClass20_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0 + 0x68(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.ElementTemplate.CreateContent + 0x27(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent + 0x8(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent + 0x69(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView + 0x16e(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ + 0x20(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L + 0x5(Unknown Source)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:41)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3119)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:577)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2214)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2115)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2052)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3327)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:3230)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3153)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:608)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2214)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2115)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2052)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3327)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3237)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1582)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.Activity.performStart(Activity.java:9034)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4206)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:225)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:205)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:177)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2693)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:230)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.os.Looper.loop(Looper.java:319)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:9063)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
02-15 16:20:53.863 10342 14606 14606 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
After working on this issue all week, I have finally found the problem. On my logon page I had an ActivityIndicator
that I was using to tell the user that I was processing their log on request. The ActivityIndicator
looked like this:
<ActivityIndicator x:Name="activityIndicator"
IsVisible="false"
IsRunning="True"
Color="{StaticResource NavigationBarColor}" ZIndex="1000"
VerticalOptions="Center" HorizontalOptions="Center"
WidthRequest="100" HeightRequest="100"/>
After dumping the device log, I discovered the error StaticResource not found for key NavigationBarColor
. The activity indicatior was the only control in my app that had NavigationBar
as a parameter, I don't use a Navigation Bar so I deleted that line, rebuilt and deployed the app. I now runs fine. I don't know why the build process didn't pick it up, but in any event it's now fixed!