-
Notifications
You must be signed in to change notification settings - Fork 12
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
[CRASH] Android app crash at runtime when debugging #231
Comments
@carldebilly on my side when testing with an android emulator I have no crashes but I can't navigate to a task list. I'm stuck on the NavigationView. (cc @nickrandolph) |
@dr1rrb there's a NullReferenceException thrown on Android when navigating to the TaskListPage. It seems to be this line that's causing the issue (I commented out a lot of the xaml and when I enabled this line it started to throw the exception again). uno.todo/src/ToDo.UI/Views/TaskListPage.xaml Line 174 in 7a9d6fb
Would you be able to take a look and see what's happening when Entity.Value is being called - the converter isn't being called, so I'm assuming it's an issue with calling Entity.Value |
@agneszitte-nventive the navigation fails as some brushes are missing on Android. In the <SolidColorBrush Color="DeepPink" x:Key="DefaultTaskListSurfaceBrush" />
<SolidColorBrush Color="DeepSkyBlue" x:Key="DefaultTaskListOnSurfaceBrush" />
<SolidColorBrush Color="Chartreuse" x:Key="ImportantTaskListSurfaceBrush" />
<SolidColorBrush Color="Orange" x:Key="ImportantTaskListOnSurfaceBrush" /> This is the issue your are observing @nickrandolph : As the converter But indeed when we pass those issues we do have crash reported by Carl. Edit: @agneszitte-nventive @carldebilly Not sure who is responsible to import the resources nor if they should be automatically imported by the figma code gen ... I won't look at them, I'm investigating the cause of the crash. |
Thanks a lot for investigating @dr1rrb !! |
About the crash itself, I noticed that the issue is due to the uno.todo/src/ToDo.UI/Views/TaskListPage.xaml Line 176 in 7a9d6fb
Even if I comment the
Note: Even if I comment the material styles I still get the exception I was not able to find where we wrongly set those properties in the app nor in Uno.Themes. My main suspect is https://github.com/unoplatform/uno/blob/7b4671c663cd71cac5f20565a8b48cf9f7c81606/src/Uno.UI/Controls/CommandBar/AppBarButtonRenderer.Android.cs#L55. But anyway as this exception is raise only in debug (https://github.com/unoplatform/uno/blob/7b4671c663cd71cac5f20565a8b48cf9f7c81606/src/Uno.UI/UI/Xaml/DependencyObjectStore.cs#L642) and the effect is probably just a minor perf hit, I don't see that as a urgent issue anymore and I will transfer the issue in the uno repo.
|
Thanks a lot for all the details @dr1rrb !! |
@dr1rrb So it appears that we cannot use a Converter when setting the Background of the NavigationBar. For some reason, it breaks the nested registration of the PropertyChanged callback here: https://github.com/unoplatform/uno.toolkit.ui/blob/650812afeed82afc5b330a28b50ba97625331446/src/Uno.Toolkit.UI/Controls/NavigationBar/NavigationBarRenderer.Android.cs#L151-L153 Removing the converter and just setting it directly to the resource does not cause a crash. And yes, Only BitmapIcon can be used for AppBarButton.Icons within the NavigationBar Also, the brushes used in the Converter have now been brought over into the Material Themes v2 package so we just need to update the packages within the ToDo app. |
Crash
I'm getting this error on Android:
Steps
Other details
The application won't crash if you're not debugging the application.
The text was updated successfully, but these errors were encountered: