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

On iOS catched getting rendering scale on non UI-thread #142

Open
taublast opened this issue Dec 2, 2024 · 0 comments
Open

On iOS catched getting rendering scale on non UI-thread #142

taublast opened this issue Dec 2, 2024 · 0 comments

Comments

@taublast
Copy link
Owner

taublast commented Dec 2, 2024

Catched in Xamarin.DrawnUi :

2024-12-02 17:44:41.257 Triggero.iOS.Test[687:114687] UIKit.UIKitThreadAccessException: UIKit Consistency error: you are calling a UIKit method that can only be invoked from the UI thread.
  at UIKit.UIApplication.EnsureUIThread () [0x00020] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.18/src/Xamarin.iOS/UIKit/UIApplication.cs:112 
  at UIKit.UIScreen.get_MainScreen () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.18/src/Xamarin.iOS/UIKit/UIScreen.g.cs:399 
  at Xamarin.Essentials.DeviceDisplay.GetMainDisplayInfo () [0x00000] in D:\a\_work\1\s\Xamarin.Essentials\DeviceDisplay\DeviceDisplay.ios.cs:18 
  at Xamarin.Essentials.DeviceDisplay.get_MainDisplayInfo () [0x00000] in D:\a\_work\1\s\Xamarin.Essentials\DeviceDisplay\DeviceDisplay.shared.cs:17 
  at DrawnUi.Maui.Models.Screen.get_DisplayInfo () [0x00000] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaControl.GetDensity () [0x00000] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaControl.get_RenderingScale () [0x0002d] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout+SkiaGridStructure.MeasureChild (DrawnUi.Maui.Draw.SkiaLayout+Cell cell) [0x00024] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout+SkiaGridStructure.MeasureCellsWithUnknowns () [0x0000d] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout+SkiaGridStructure.MeasureCells () [0x00000] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout+SkiaGridStructure..ctor (DrawnUi.Maui.Draw.ISkiaGridLayout grid, System.Double widthConstraint, System.Double heightConstraint) [0x00140] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout.BuildGridLayout (SkiaSharp.SKSize constraints) [0x00011] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout.MeasureGrid (SkiaSharp.SKRect rectForChildrenPixels, System.Single scale) [0x0000e] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout.MeasureLayout (DrawnUi.Maui.Draw.MeasureRequest request, System.Boolean force) [0x0009d] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0 
  at DrawnUi.Maui.Draw.SkiaLayout.Measure (System.Single widthConstraint, System.Single heightConstraint, System.Single scale) [0x0011b] in <7b13fec9a3714a42a8cf37bd55f6f0bb>:0

To either totally cut usage of Essentials here, or use tricks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant