davidortinau / WeatherTwentyOne

MIT License
923 stars 218 forks source link

"Access to the path '/data/fonts' is denied." #50

Open r-ulak opened 2 years ago

r-ulak commented 2 years ago

When running this project , running on Samsung S21 via USB debug mode

{System.UnauthorizedAccessException: Access to the path '/data/fonts' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at System.IO.Enumeration.FileSystemEnumerator1[[System.IO.FileInfo, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateDirectoryHandle(String path, Boolean ignoreNotFound) at System.IO.Enumeration.FileSystemEnumerator1[[System.IO.FileInfo, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Init() at System.IO.Enumeration.FileSystemEnumerator1[[System.IO.FileInfo, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(String directory, Boolean isNormalized, EnumerationOptions options) at System.IO.Enumeration.FileSystemEnumerable1.DelegateEnumerator[[System.IO.FileInfo, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(FileSystemEnumerable1 enumerable, Boolean isNormalized) at System.IO.Enumeration.FileSystemEnumerable1[[System.IO.FileInfo, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized) at System.IO.Enumeration.FileSystemEnumerableFactory.FileInfos(String directory, String expression, EnumerationOptions options, Boolean isNormalized) at System.IO.DirectoryInfo.InternalEnumerateInfos(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options) at System.IO.DirectoryInfo.GetFiles(String searchPattern, EnumerationOptions enumerationOptions) at System.IO.DirectoryInfo.GetFiles() at Microsoft.Maui.Graphics.Native.NativeFontService.InitializeFonts() in D:\a\1\s\src\Microsoft.Maui.Graphics\Android\NativeFontService.cs:line 172 at Microsoft.Maui.Graphics.Native.NativeFontService.GetFontFamilies() in D:\a\1\s\src\Microsoft.Maui.Graphics\Android\NativeFontService.cs:line 43 at Microsoft.Maui.Graphics.AbstractFontService.GetFontStyleById(String id) in D:\a\1\s\src\Microsoft.Maui.Graphics\AbstractFontService.cs:line 70 at Microsoft.Maui.Graphics.Native.NativeFontService.GetTypeface(String name) in D:\a\1\s\src\Microsoft.Maui.Graphics\Android\NativeFontService.cs:line 281 at Microsoft.Maui.Graphics.Native.NativeCanvas.CreateNewState(Object context) in D:\a\1\s\src\Microsoft.Maui.Graphics\Android\NativeCanvas.cs:line 46 at Microsoft.Maui.Graphics.AbstractCanvas1[[Microsoft.Maui.Graphics.Native.NativeCanvasState, Microsoft.Maui.Graphics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]..ctor(Func2 createNew, Func2 createCopy) in D:\a\1\s\src\Microsoft.Maui.Graphics\AbstractCanvas.cs:line 36 at Microsoft.Maui.Graphics.Native.NativeCanvas..ctor(Context context) in D:\a\1\s\src\Microsoft.Maui.Graphics\Android\NativeCanvas.cs:line 21 at Microsoft.Maui.Graphics.Native.NativeGraphicsView..ctor(Context context, IDrawable drawable) in D:\a\1\s\src\Microsoft.Maui.Graphics\Android\NativeGraphicsView.cs:line 28 at Microsoft.Maui.MauiShapeView..ctor(Context context) in D:\a\1\s\src\Core\src\Platform\Android\MauiShapeView.cs:line 8 at Microsoft.Maui.Handlers.ShapeViewHandler.CreateNativeView() in D:\a\1\s\src\Core\src\Handlers\ShapeView\ShapeViewHandler.Android.cs:line 8 at Microsoft.Maui.Handlers.ViewHandler2[[Microsoft.Maui.IShapeView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.MauiShapeView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].OnCreateNativeView() in D:\a\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 70 at Microsoft.Maui.Handlers.ViewHandler.OnCreateNativeElement() in D:\a\1\s\src\Core\src\Handlers\View\ViewHandler.cs:line 118 at Microsoft.Maui.Handlers.ElementHandler.CreateNativeElement() in D:\a\1\s\src\Core\src\Handlers\Element\ElementHandler.cs:line 96 at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view) in D:\a\1\s\src\Core\src\Handlers\Element\ElementHandler.cs:line 52 at Microsoft.Maui.Handlers.ViewHandler2[[Microsoft.Maui.IShapeView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.MauiShapeView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view) in D:\a\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 51 at Microsoft.Maui.Handlers.ViewHandler2[[Microsoft.Maui.IShapeView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.MauiShapeView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view) in D:\a\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 54 at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) in D:\a\1\s\src\Controls\src\Core\HandlerImpl\Element.Impl.cs:line 62 at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) in D:\a\1\s\src\Controls\src\Core\HandlerImpl\Element.Impl.cs:line 18 at Microsoft.Maui.HandlerExtensions.ToHandler(IElement view, IMauiContext context) in D:\a\1\s\src\Core\src\Platform\Android\HandlerExtensions.cs:line 62 at Microsoft.Maui.HandlerExtensions.ToNative(IElement view, IMauiContext context) in D:\a\1\s\src\Core\src\Platform\Android\HandlerExtensions.cs:line 35 at Microsoft.Maui.Controls.Platform.ShellContentView.OnViewSet(View view) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellContentView.cs:line 207 at Microsoft.Maui.Controls.Platform.ShellContentView.set_View(View value) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellContentView.cs:line 46 at Microsoft.Maui.Controls.Platform.ShellContentView..ctor(Context context, View view, IMauiContext mauiContext) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellContentView.cs:line 38 at Microsoft.Maui.Controls.Platform.ShellContainerView.OnViewSet(View view) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellContainerView.cs:line 153 at Microsoft.Maui.Controls.Platform.ShellContainerView.set_View(View value) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellContainerView.cs:line 38 at Microsoft.Maui.Controls.Platform.ShellContainerView..ctor(Context context, View view, IMauiContext mauiContext) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellContainerView.cs:line 20 at Microsoft.Maui.Controls.Platform.ShellFlyoutTemplatedContentView.HeaderContainer..ctor(Context context, View view, IMauiContext mauiContext) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellFlyoutTemplatedContentView.cs:line 514 at Microsoft.Maui.Controls.Platform.ShellFlyoutTemplatedContentView.UpdateFlyoutHeader() in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellFlyoutTemplatedContentView.cs:line 231 at Microsoft.Maui.Controls.Platform.ShellFlyoutTemplatedContentView.LoadView(IShellContext shellContext) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellFlyoutTemplatedContentView.cs:line 76 at Microsoft.Maui.Controls.Platform.ShellFlyoutTemplatedContentView..ctor(IShellContext shellContext) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellFlyoutTemplatedContentView.cs:line 55 at Microsoft.Maui.Controls.Platform.ShellView.CreateShellFlyoutContentView() in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellView.cs:line 134 at Microsoft.Maui.Controls.Platform.ShellView.Microsoft.Maui.Controls.Platform.IShellContext.CreateShellFlyoutContentView() in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellView.cs:line 44 at Microsoft.Maui.Controls.Platform.ShellFlyoutView.AttachFlyout(IShellContext context, View content) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellFlyoutView.cs:line 180 at Microsoft.Maui.Controls.Platform.ShellFlyoutView.Microsoft.Maui.Controls.Platform.IShellFlyoutView.AttachFlyout(IShellContext context, View content) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellFlyoutView.cs:line 64 at Microsoft.Maui.Controls.Platform.ShellView.OnElementSet(Shell shell) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellView.cs:line 212 at Microsoft.Maui.Controls.Platform.ShellView.SetVirtualView(Shell shell) in D:\a\1\s\src\Controls\src\Core\Platform\Android\Shell\ShellView.cs:line 189 at Microsoft.Maui.Controls.Handlers.ShellHandler.SetVirtualView(IView view) in D:\a\1\s\src\Controls\src\Core\Handlers\Shell\ShellHandler.Android.cs:line 24 at Microsoft.Maui.Handlers.ViewHandler2[[Microsoft.Maui.Controls.Shell, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Controls.Platform.ShellFlyoutView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view) in D:\a\1\s\src\Core\src\Handlers\View\ViewHandlerOfT.cs:line 54 at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) in D:\a\1\s\src\Controls\src\Core\HandlerImpl\Element.Impl.cs:line 62 at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) in D:\a\1\s\src\Controls\src\Core\HandlerImpl\Element.Impl.cs:line 18 at Microsoft.Maui.HandlerExtensions.ToHandler(IElement view, IMauiContext context) in D:\a\1\s\src\Core\src\Platform\Android\HandlerExtensions.cs:line 62 at Microsoft.Maui.HandlerExtensions.ToNative(IElement view, IMauiContext context) in D:\a\1\s\src\Core\src\Platform\Android\HandlerExtensions.cs:line 35 at Microsoft.Maui.ContainerView.SetView(IElement view, Boolean forceRefresh) in D:\a\1\s\src\Core\src\Platform\Android\ContainerView.cs:line 72 at Microsoft.Maui.ContainerView.set_CurrentView(IElement value) in D:\a\1\s\src\Core\src\Platform\Android\ContainerView.cs:line 51 at Microsoft.Maui.HandlerExtensions.ToContainerView(IElement view, IMauiContext context) in D:\a\1\s\src\Core\src\Platform\Android\HandlerExtensions.cs:line 31 at Microsoft.Maui.Controls.Window.MapContent(WindowHandler handler, IWindow view) in D:\a\1\s\src\Controls\src\Core\HandlerImpl\Window\Window.cs:line 41 at Microsoft.Maui.PropertyMapper2.<>c__DisplayClass5_0[[Microsoft.Maui.IWindow, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Handlers.WindowHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].b__0(IElementHandler h, IElement v) in D:\a\1\s\src\Core\src\PropertyMapper.cs:line 163 at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView) in D:\a\1\s\src\Core\src\PropertyMapper.cs:line 35 at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView) in D:\a\1\s\src\Core\src\PropertyMapper.cs:line 70 at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view) in D:\a\1\s\src\Core\src\Handlers\Element\ElementHandler.cs:line 74 at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler) in D:\a\1\s\src\Controls\src\Core\HandlerImpl\Element.Impl.cs:line 62 at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value) in D:\a\1\s\src\Controls\src\Core\HandlerImpl\Element.Impl.cs:line 18 at Microsoft.Maui.HandlerExtensions.SetHandler(Context nativeElement, IElement element, IMauiContext context) in D:\a\1\s\src\Core\src\Platform\Android\HandlerExtensions.cs:line 94 at Microsoft.Maui.HandlerExtensions.SetWindowHandler(Activity activity, IWindow window, IMauiContext context) in D:\a\1\s\src\Core\src\Platform\Android\HandlerExtensions.cs:line 74 at Microsoft.Maui.Platform.ApplicationExtensions.CreateNativeWindow(Activity activity, IApplication application, Bundle savedInstanceState) in D:\a\1\s\src\Core\src\Platform\Android\ApplicationExtensions.cs:line 27 at Microsoft.Maui.MauiAppCompatActivity.OnCreate(Bundle savedInstanceState) in D:\a\1\s\src\Core\src\Platform\Android\MauiAppCompatActivity.cs:line 31 at WeatherTwentyOne.MainActivity.OnCreate(Bundle savedInstanceState) in D:\github\davidortinau\WeatherTwentyOne\src\WeatherTwentyOne\Platforms\Android\MainActivity.cs:line 15 at Android.App.Activity.n_OnCreate_Landroid_osBundle(IntPtr

moemura commented 2 years ago

It happened to on Redmi 6. Looks like real device problem. Everything is smooth in emulator

tjiakwokyung28 commented 1 year ago

Yes, when we comsume custome font in net 7.0, is denied