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

Android Release build crashes on device but Debug build runs #19165

Open
gtidev1 opened this issue Dec 1, 2023 · 10 comments
Open

Android Release build crashes on device but Debug build runs #19165

gtidev1 opened this issue Dec 1, 2023 · 10 comments
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/enhancement ☀️ New feature or request
Milestone

Comments

@gtidev1
Copy link

gtidev1 commented Dec 1, 2023

Description

Unexpected release build crash on Android device (after the same code works on the device as a debug build)

Steps to Reproduce

  1. Create the sample MAUI project (Visual Studio 17.8.2, net8.0) and run the Debug build on an Android device
  2. Add this to MainPage.xaml <Entry Style="{StaticResource MisssingStyle}" Text="Placeholder" />
  3. Rerun the Debug build on the Android device. It executes and shows the new UI element
  4. Switch to Release build and run on the Android device with crash info attached

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

After working for some time (after a typo) running Debug builds, finding the bug takes too long. The Android logcat info is useless. I did not see any useful warning/error info using the default configuration of the developer environment either.
Requests:
Can the developer environment indicate in the editor window some warning/error for a resource that is a typo / missing
Can the build process indicate in the output some warning/error for a resource that is a typo / missing
Can the behavior (on device) of the Release build and Debug build be made the same for a resource that is a typo / missing (either both builds work or both builds fail)

Possibly related issues:
#15602
#8928

Relevant log output

Time	Device Name	Type	PID	Tag	Message
12-01 15:34:52.036	OnePlus LE2115	Warning	1890	OplusEapManager handleErrorInfo sendEvent:	com.companyname.mauiandroidreleasecrash Crashed
12-01 15:34:52.036	OnePlus LE2115	Debug	1890	TheiaManager	sendEvent {0x5 6878579 0x1003 21230 10210 com.companyname.mauiandroidreleasecrash}
12-01 15:34:52.034	OnePlus LE2115	Debug	3803	BufferQueueConsumer	[VRI[Launcher]#29(BLAST Consumer)29](id:edb00000040,api:0,p:-1,c:3803) disconnect
12-01 15:34:52.034	OnePlus LE2115	Debug	1890	OplusAppStartupMonitor	notifyUnstableAppInfo: Bundle[{unstableTime=1701466492033, reason=crash, userId=0, exceptionMsg=[System.Reflection.TargetInvocationException]: Arg_TargetInvocationException, exceptionClass=android.runtime.JavaProxyThrowable, app_channel_type=unstable, packageName=com.companyname.mauiandroidreleasecrash, unstable_restrict_switch=true}]
12-01 15:34:52.031	OnePlus LE2115	Verbose	1890	WindowManager	Relayout Window{bc4f5b4 u0 com.android.launcher/com.android.launcher.Launcher}: viewVisibility=8, oldvis=0, req=1080x2400
12-01 15:34:52.030	OnePlus LE2115	Info	21230	MonoDroid	
12-01 15:34:52.030	OnePlus LE2115	Info	21230	MonoDroid	android.runtime.JavaProxyThrowable: [System.Reflection.TargetInvocationException]: Arg_TargetInvocationException
	at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Unknown Source:0)
	at System.RuntimeType.CreateInstanceMono(Unknown Source:0)
	at System.RuntimeType.CreateInstanceDefaultCtor(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at Microsoft.Maui.Controls.ShellContent+<>c__DisplayClass19_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0(Unknown Source:0)
	at Microsoft.Maui.Controls.ElementTemplate.CreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView(Unknown Source:0)
	at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(Unknown Source:0)
	at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(Unknown Source:0)
	at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
	at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:44)
	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3114)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:557)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3042)
	at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:2945)
	at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3148)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:588)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3042)
	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2952)
	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1529)
	at android.app.Activity.performStart(Activity.java:8447)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3897)
	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:2470)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:240)
	at android.os.Looper.loop(Looper.java:351)
	at android.app.ActivityThread.main(ActivityThread.java:8423)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
12-01 15:34:52.030	OnePlus LE2115	Info	21230	MonoDroid	
  --- End of managed Android.Runtime.JavaProxyThrowable stack trace ---
12-01 15:34:52.030	OnePlus LE2115	Info	21230	MonoDroid	android.runtime.JavaProxyThrowable: [System.Reflection.TargetInvocationException]: Arg_TargetInvocationException
	at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Unknown Source:0)
	at System.RuntimeType.CreateInstanceMono(Unknown Source:0)
	at System.RuntimeType.CreateInstanceDefaultCtor(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at Microsoft.Maui.Controls.ShellContent+<>c__DisplayClass19_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0(Unknown Source:0)
	at Microsoft.Maui.Controls.ElementTemplate.CreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView(Unknown Source:0)
	at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(Unknown Source:0)
	at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(Unknown Source:0)
	at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
	at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:44)
	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3114)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:557)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3042)
	at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:2945)
	at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3148)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:588)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3042)
	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2952)
	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1529)
	at android.app.Activity.performStart(Activity.java:8447)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3897)
	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:2470)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:240)
	at android.os.Looper.loop(Looper.java:351)
	at android.app.ActivityThread.main(ActivityThread.java:8423)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
12-01 15:34:52.030	OnePlus LE2115	Info	21230	MonoDroid	
  --- End of managed Android.Runtime.JavaProxyThrowable stack trace ---
12-01 15:34:52.030	OnePlus LE2115	Info	21230	MonoDroid	Android.Runtime.JavaProxyThrowable: Exception_WasThrown, Android.Runtime.JavaProxyThrowable
12-01 15:34:52.029	OnePlus LE2115	Error	1456	SchedAssist	ofbSetSfMsgTrans pid(1456) failed with error=Permission denied
12-01 15:34:52.027	OnePlus LE2115	Info	21230	MonoDroid	UNHANDLED EXCEPTION:
12-01 15:34:52.027	OnePlus LE2115	Warning	21230	monodroid-assembly	Shared library 'liblog' not loaded, p/invoke '__android_log_print' may fail
12-01 15:34:52.025	OnePlus LE2115	Error	21230	AndroidRuntime	android.runtime.JavaProxyThrowable: [System.Reflection.TargetInvocationException]: Arg_TargetInvocationException
	at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Unknown Source:0)
	at System.RuntimeType.CreateInstanceMono(Unknown Source:0)
	at System.RuntimeType.CreateInstanceDefaultCtor(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at System.Activator.CreateInstance(Unknown Source:0)
	at Microsoft.Maui.Controls.ShellContent+<>c__DisplayClass19_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0(Unknown Source:0)
	at Microsoft.Maui.Controls.ElementTemplate.CreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent(Unknown Source:0)
	at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView(Unknown Source:0)
	at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(Unknown Source:0)
	at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(Unknown Source:0)
	at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
	at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:44)
	at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3114)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:557)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3042)
	at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:2945)
	at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3148)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:588)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:272)
	at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1943)
	at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1845)
	at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1782)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3042)
	at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2952)
	at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1529)
	at android.app.Activity.performStart(Activity.java:8447)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3897)
	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:2470)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:240)
	at android.os.Looper.loop(Looper.java:351)
	at android.app.ActivityThread.main(ActivityThread.java:8423)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
12-01 15:34:52.025	OnePlus LE2115	Error	21230	AndroidRuntime	Process: com.companyname.mauiandroidreleasecrash, PID: 21230
12-01 15:34:52.025	OnePlus LE2115	Error	21230	AndroidRuntime	FATAL EXCEPTION: main
12-01 15:34:52.024	OnePlus LE2115	Debug	21230	AndroidRuntime	Shutting down VM
@gtidev1 gtidev1 added the t/bug Something isn't working label Dec 1, 2023
@Eilon Eilon added the area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) label Dec 2, 2023
@BaY1251
Copy link
Contributor

BaY1251 commented Dec 4, 2023

+1

@kevinxufei
Copy link

Verified this issue with Visual Studio 17.10.0 Preview 3 (8.0.20 & 8.0.0-rc.2.9530). Can repro this issue on Android device (api33).

@kevinxufei kevinxufei added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 16, 2024
@TimurVa
Copy link

TimurVa commented Apr 17, 2024

I'm checking every release made by this repo since prev year. Not a single handles this. Every time I start my app in Debug it works. Switch to Release and getting crush with exact same error. Even Debug build can't start. Only via Visual Studio Debug through USB

@bsdRuf
Copy link

bsdRuf commented Jun 4, 2024

same issue here, if any info is helping to find a fix or workaround please have a look. Otherwise it can be closed since this is open already.
#22825

@mattleibow
Copy link
Member

mattleibow commented Nov 21, 2024

I believe the debug log window in VS will show errors with bindings.

Let me know if the errors do not show in the debug window.

@mattleibow mattleibow added s/needs-info Issue needs more info from the author t/bug Something isn't working platform/android 🤖 area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) s/try-latest-version Please try to reproduce the potential issue on the latest public version s/verified Verified / Reproducible Issue ready for Engineering Triage and removed t/bug Something isn't working platform/android 🤖 area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Nov 21, 2024
@mattleibow mattleibow added the s/triaged Issue has been reviewed label Nov 21, 2024
@dotnet-policy-service dotnet-policy-service bot added the s/no-recent-activity Issue has had no recent activity label Nov 26, 2024
@gtidev1
Copy link
Author

gtidev1 commented Nov 26, 2024

I will attempt to retest this issue in the next few days

@dotnet-policy-service dotnet-policy-service bot added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author s/no-recent-activity Issue has had no recent activity s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Nov 26, 2024
@gtidev1
Copy link
Author

gtidev1 commented Nov 27, 2024

The exception info available at app crash in Android device log (when manually launched on device) is now helpful. But see below.

The steps to reproduce still have undesired behavior (tested on Samsung device w/Android 13, also OnePlus device w/Android 14).
The problem behavior is:

  1. Debug the debug app from within Visual Studio ... incorrectly this ignores the problem of the missing style and it appears that the UI is fine
  2. Manually launch the debug app on the device ... crash with stack below
  3. Manually launch the release build app on the device ... crash with stack below

I suggest this issue remain open until:

  • Get the exception that will occur if the app is manually launched to also occur as an exception during debug within Visual Studio

`Version 17.13.0 Preview 1.0
.NET 9.0.100-rc.2.24474.11

After adding a typo/missing style to MainPage.xaml (see step 2 of Steps to Reproduce)

No Build errors/warnings about the missing style (e.g. none in Build Output)

CASE 1 Debug the app on device from Visual Studio
Incorrectly, the UI Entry Element with missing style is functional in the app being debugged

CASE 2 Manually launch the same debug build on the device (Android device log)

Time Device Name Type PID Tag Message
11-27 13:23:04.885 Samsung SM-G986B Error 14747 AndroidRuntime android.runtime.JavaProxyThrowable: [Microsoft.Maui.Controls.Xaml.XamlParseException]: Position 26:20. StaticResource not found for key MisssingStyle
at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor.ProvideValue + 0xa7(Unknown Source)
at Microsoft.Maui.Controls.Xaml.ApplyPropertiesVisitor.Visit + 0xea(Unknown Source)
at Microsoft.Maui.Controls.Xaml.ElementNode.Accept + 0x90(Unknown Source)
at Microsoft.Maui.Controls.Xaml.ElementNode.Accept + 0x3e(Unknown Source)
at Microsoft.Maui.Controls.Xaml.ElementNode.Accept + 0x67(Unknown Source)
at Microsoft.Maui.Controls.Xaml.ElementNode.Accept + 0x67(Unknown Source)
at Microsoft.Maui.Controls.Xaml.RootNode.Accept + 0x81(Unknown Source)
at Microsoft.Maui.Controls.Xaml.XamlLoader.Visit + 0x97(Unknown Source)
at Microsoft.Maui.Controls.Xaml.XamlLoader.Load + 0x9d(Unknown Source)
at Microsoft.Maui.Controls.Xaml.XamlLoader.Load + 0x0(Unknown Source)
at Microsoft.Maui.Controls.Xaml.XamlLoader.Load + 0x29(Unknown Source)
at Microsoft.Maui.Controls.Xaml.Extensions.LoadFromXaml + 0x0(Unknown Source)
at MauiApp1.MainPage.InitializeComponent + 0x1(Unknown Source)
at MauiApp1.MainPage..ctor + 0xf(Unknown Source)
at Unknown.Unknown(Unknown Source)
at System.Reflection.ConstructorInvoker.InterpretedInvoke + 0x0(Unknown Source)
at System.Reflection.ConstructorInvoker.InvokeDirectByRefWithFewArgs + 0x7d(Unknown Source)
at System.Reflection.ConstructorInvoker.InvokeDirectByRef + 0xc(Unknown Source)
at System.Reflection.ConstructorInvoker.InvokeImpl + 0xbe(Unknown Source)
at System.Reflection.ConstructorInvoker.Invoke + 0x47(Unknown Source)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ConstructorMatcher.CreateInstance + 0xa4(Unknown Source)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance + 0x1d7(Unknown Source)
at Microsoft.Maui.Controls.ShellContent+<>c__DisplayClass20_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0 + 0x57(Unknown Source)
at Microsoft.Maui.Controls.ElementTemplate.CreateContent + 0x21(Unknown Source)
at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent + 0x0(Unknown Source)
at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent + 0x69(Unknown Source)
at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView + 0x168(Unknown Source)
at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ + 0x0(Unknown Source)
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L + 0x5(Unknown Source)
at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:41)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3119)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:577)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2164)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2065)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3277)
at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:3180)
at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3153)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:608)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2164)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2065)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3277)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3187)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1510)
at android.app.Activity.performStart(Activity.java:8616)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4204)
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:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

CASE 3 Manually launch the Release build on the device (Android device log)

Time Device Name Type PID Tag Message
11-27 12:32:08.017 Samsung SM-G986B Error 4895 AndroidRuntime android.runtime.JavaProxyThrowable: [Microsoft.Maui.Controls.Xaml.XamlParseException]: Position 26:20. StaticResource not found for key MisssingStyle
at Microsoft.Maui.Controls.Xaml.StaticResourceExtension.ProvideValue + 0xad(Unknown Source)
at MauiApp1.MainPage.InitializeComponent + 0x402(Unknown Source)
at MauiApp1.MainPage..ctor + 0x6(Unknown Source)
at Unknown.Unknown(Unknown Source)
at System.Reflection.ConstructorInvoker.InterpretedInvoke + 0x0(Unknown Source)
at System.Reflection.ConstructorInvoker.InvokeDirectByRefWithFewArgs + 0x7d(Unknown Source)
at System.Reflection.ConstructorInvoker.InvokeDirectByRef + 0x29(Unknown Source)
at System.Reflection.ConstructorInvoker.InvokeImpl + 0xbe(Unknown Source)
at System.Reflection.ConstructorInvoker.Invoke + 0x47(Unknown Source)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities+ConstructorMatcher.CreateInstance + 0xc8(Unknown Source)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance + 0x1d7(Unknown Source)
at Microsoft.Maui.Controls.ShellContent+<>c__DisplayClass20_0.<Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent>b__0 + 0x68(Unknown Source)
at Microsoft.Maui.Controls.ElementTemplate.CreateContent + 0x27(Unknown Source)
at Microsoft.Maui.Controls.Internals.DataTemplateExtensions.CreateContent + 0x8(Unknown Source)
at Microsoft.Maui.Controls.ShellContent.Microsoft.Maui.Controls.IShellContentController.GetOrCreateContent + 0x69(Unknown Source)
at Microsoft.Maui.Controls.Platform.Compatibility.ShellSectionRenderer.OnCreateView + 0x16e(Unknown Source)
at AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ + 0x20(Unknown Source)
at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L + 0x5(Unknown Source)
at crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(Native Method)
at crc640ec207abc449b2ca.ShellSectionRenderer.onCreateView(ShellSectionRenderer.java:41)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3119)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:577)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2164)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2065)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3277)
at androidx.fragment.app.FragmentManager.dispatchViewCreated(FragmentManager.java:3180)
at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3153)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:608)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:286)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2164)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2065)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:2002)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3277)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3187)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:263)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:350)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1510)
at android.app.Activity.performStart(Activity.java:8616)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:4204)
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:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
`

@mattleibow
Copy link
Member

Running the app in debug on Windows, I get an exception at startup:

{"Position 16:20. StaticResource not found for key MisssingStyle"}

Not sure why nothing is logged on Android.

@mattleibow mattleibow added t/enhancement ☀️ New feature or request and removed t/bug Something isn't working labels Dec 4, 2024
@mattleibow mattleibow added this to the Backlog milestone Dec 4, 2024
@mattleibow mattleibow removed the s/needs-attention Issue has more information and needs another look label Dec 4, 2024
@mattleibow
Copy link
Member

@StephaneDelcroix should missing styles be logged to the console and/or the XAML errors window?

@TE-Develop
Copy link

I had the same issue myself. If you search on the internet, there are quite a lot of complaints about this.

Gtidev1 is right. Both the debug and release versions should generate an easy-to-understand exception, even on Android.

From my point of view, it's a clear bug if the debug build just ignores unresolvable style names. So I cannot quite understand the decision to remove the "bug" flag. Even if it works on Windows, there is still this bug when working on Android, and the whole reason for MAUI is multi-platform.

But please know, I appreciate your work on MAUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/enhancement ☀️ New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants