davidortinau / weathertwentyone Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
After removing the code signing lines from the csproj and running:
dotnet build -t:Run -f net6.0-maccatalyst
The app launches, but I don't see any menu bar icon..
I see several references to .png images, in for example App.xaml
:
<!-- Desktop/Tablet-->
<FlyoutItem Title="Home" Icon="tab_home.png">
<ShellContent ContentTemplate="{DataTemplate page:HomePage}"/>
</FlyoutItem>
<FlyoutItem Title="Favorites" Icon="tab_favorites.png">
<ShellContent ContentTemplate="{DataTemplate page:FavoritesPage}"/>
</FlyoutItem>
<FlyoutItem Title="Map" Icon="tab_map.png">
<ShellContent ContentTemplate="{DataTemplate page:MapPage}"/>
</FlyoutItem>
<FlyoutItem Route="settings" Icon="tab_map.png" >
<ShellContent ContentTemplate="{DataTemplate page:SettingsPage}"/>
</FlyoutItem>
<!-- Phone -->
<TabBar x:Name="PhoneTabs">
<Tab Title="Hem" Icon="tab_home.png">
<ShellContent ContentTemplate="{DataTemplate page:HomePage}"/>
</Tab>
<Tab Title="Favorites" Icon="tab_favorites.png">
<ShellContent ContentTemplate="{DataTemplate page:FavoritesPage}"/>
</Tab>
<Tab Title="Map" Icon="tab_map.png">
<ShellContent ContentTemplate="{DataTemplate page:MapPage}"/>
</Tab>
<Tab Title="Settings" Icon="tab_settings.png">
<ShellContent ContentTemplate="{DataTemplate page:SettingsPage}"/>
</Tab>
</TabBar>
But, when I try to find those image files in the solution, I can't find them - there are no tab_home.png
, tab_favorites.png
or tab_map.png
. However, in Resources/Images
I find the .svg
versions:
Resources/Images/tab_home.svg
Resources/Images/tab_favorites.svg
Resources/Images/tab_map.svg
Also in the \src\WeatherTwentyOne\Converters\ActiveTabConverter.cs
, the png files are references (as hardcoded strings).
So, what am I missing here? How can the application display the icons (cause they are displayed correctly) when the file names are wrong?
Hi Team,
when compiling in my MSVS 17 preview 3.1, I get a compilation error that PInvoke.User32
cannot be found. Could it be fixed?
Thank you
I guess that in 'SettingsViewModel.cs' all 'OSAppTheme' occurrences should become 'AppTheme'.
Use some triggers!
Need only for internal testing in google play store
How would you change your solution to also add the web as a target, the only missing target for a enterprise solution? One code for ALL platforms ;)
Great work so far. I love it. I am quite excited about the new Maui
I see that to add the Windows Tray Icon you had to do a lot of Native Windows code to get it implemented, is this something that will change in the future? or should I go ahead and do that in my application?
Implement a form to add a location when clicking the plus icon on Favorites.
Design and implement an app specific icon
DEP0700: Registration of the app failed. [0x80073CF6] AppxManifest.xml(33,27): errore 0x80070003: impossibile installare o aggiornare il pacchetto BA0275D4-73C9-4F0C-BF53-CAC4FAD28D12_9zz4h110yvjzm. Non Γ¨ possibile individuare l'immagine [appiconfgSplashScreen.png] della schermata iniziale. Verificare che il pacchetto contenga un'immagine utilizzabile come schermata iniziale per l'applicazione e che il manifesto del pacchetto faccia riferimento alla posizione corretta all'interno del pacchetto in cui trovare l'immagine.
Error Building on MAUI RC1 (Target Platform:Windows or Android).
App Icon and color would be nice, or hide altogether and implement a modern looking bar.
This is to show how we can build a MAUI app on AzureDevops.
Thank you
This demo built and worked fine with Preview 13 on Android, iOS and Windows. However with Preview 14 it won't build for Windows because it is looking for appiconfgSplashScreen.png in the Assets folder. There is no Assets folder. What I did was remove the reference under the Windows platform folder in the Package.appxmanifest file under uap:VisualElements. Then it built and ran.
<Applications> <Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$"> <uap:VisualElements/> </Application> </Applications>
I cloned the project and ran it with the newest everything 16.11.0. I get the following deployment error. Any ideas?:
DEP1700: The recipe file "C:\Users\xhor606\source\repos\MauiWeatherApp\src\WeatherTwentyOne.WinUI3 (Package)\bin\x86\Debug\WeatherTwentyOne.WinUI3 (Package).build.appxrecipe" does not exist. You may need to build your project. WeatherTwentyOne.WinUI3 (Package)
Design and implement an app specific splash screen
I have production experience with React Native. Mobile development is fun but React Native has some issues. .NET MAUI seems like a good alternative although I am a bit confused by the lack of documentation and tutorials.
My main problem right now is that every learning resource that I found forces me to use Visual Studio. I know that for Android / iOS development I usually need to use official IDEs. However, when it comes to cross-platform development I would expect more freedom. For example what if I want to use Rider for the development? What if I want to use VSCode? (I noticed that the author of this repository used VSCode)
Is there any CLI tool available? Could you please point me in the right direction?
Example:
npx react-native run-ios
I can also specify the device.npx react-native run-ios
. Honestly, I am not sure if I even need Android Studio. I think I do for the build but when it comes to emulator I can use Genymotion instead of Android Studio. How do I run .NET MAUI application with Genymotion?Thank you. Any additional learning resources would be highly appreciated. Especially anything that isn't locked in the Windows ecosystem. π
I'm feeling quite foolish about this, being a long-time VS/.NET dev, but I haven't figured out how to launch the Windows version of the app. What am I missing? I've set "WeatherTwentyOne.WinUI" as my startup project, and when I attempt to run the project I get "Unable to start debugging. The startup project cannot be launched. ..."
Admittedly I'm very new to Maui (this is my first attempt even to look at a Maui app), but....
Menu(Shell Flyout) for Desktop/tablet not showing correctly.
If this code is removed, icons appers but different.
<Shell.ItemTemplate>
<DataTemplate>
<Grid
RowDefinitions="68" HeightRequest="68">
<Image Source="{Binding FlyoutIcon}"
VerticalOptions="Center"
HorizontalOptions="Center"
/>
</Grid>
</DataTemplate>
</Shell.ItemTemplate>
Is a bug? or just is missing code?
Thanks
I installed all prerequisites for .Net MAUI, the latest VS 2022 (17.0.0 Preview 2.1) and the maui-check. Everything looks good from this perspective and I can create a new maui project and run it on any platform. Nevertheless I've tried to download and run the weather app as is. While it's working fine on android, on windows (10.0.19043) it shows the first page but no content nor the menu/tabbar.
I see from the output that it cannot fetch a font for some reasons:
Microsoft.Maui.FontManager: Error: Error loading font 'ms-appx:///Assets/OpenSans-SemiBold.ttf'.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Runtime.InteropServices.COMException (0x80040154): Classe non enregistrΓ©e (0x80040154 (REGDB_E_CLASSNOTREG))
at WinRT.BaseActivationFactory..ctor(String typeNamespace, String typeFullName) in Microsoft.Graphics.Canvas.Interop.dll:token 0x6000023+0x6e
at WinRT.ActivationFactory`1..ctor() in Microsoft.Graphics.Canvas.Interop.dll:token 0x6000027+0x0
at System.RuntimeType.CreateInstanceOfT() in System.Private.CoreLib.dll:token 0x6000681+0x3e
--- End of inner exception stack trace ---
at System.RuntimeType.CreateInstanceOfT() in System.Private.CoreLib.dll:token 0x6000681+0x4e
at System.Activator.CreateInstance[T]() in System.Private.CoreLib.dll:token 0x60009a4+0x0
at WinRT.WeakLazy`1.get_Value() in Microsoft.Graphics.Canvas.Interop.dll:token 0x6000019+0x20
at WinRT.ActivationFactory`1.As(Guid iid) in Microsoft.Graphics.Canvas.Interop.dll:token 0x600002a+0x0
at Microsoft.Graphics.Canvas.Text.CanvasFontSet._ICanvasFontSetFactory..ctor() in Microsoft.Graphics.Canvas.Interop.dll:token 0x6003792+0x1c
at System.RuntimeType.CreateInstanceOfT() in System.Private.CoreLib.dll:token 0x6000681+0x3e
--- End of inner exception stack trace ---
at System.RuntimeType.CreateInstanceOfT() in System.Private.CoreLib.dll:token 0x6000681+0x4e
at System.Activator.CreateInstance[T]() in System.Private.CoreLib.dll:token 0x60009a4+0x0
at WinRT.WeakLazy`1.get_Value() in Microsoft.Graphics.Canvas.Interop.dll:token 0x6000019+0x20
at Microsoft.Graphics.Canvas.Text.CanvasFontSet._ICanvasFontSetFactory.get_Instance() in Microsoft.Graphics.Canvas.Interop.dll:token 0x6003793+0x0
at Microsoft.Graphics.Canvas.Text.CanvasFontSet.<>c__DisplayClass8_0.<.ctor>b__0() in Microsoft.Graphics.Canvas.Interop.dll:token 0x60037a2+0x0
at Microsoft.Graphics.Canvas.Text.CanvasFontSet..ctor(Uri uri) in Microsoft.Graphics.Canvas.Interop.dll:token 0x6001c41+0x1a
at Microsoft.Maui.FontManager.FindFontFamilyName(String fontFile) in Microsoft.Maui.dll:token 0x60000e0+0x3a
Microsoft.Maui.FontManager: Error: Error loading font 'ms-appx:///Assets/OpenSans-Regular.ttf'.
But even when I remove the fonts I still have the same behavior so I don't think this is related.
Any idea what could I be missing ?
Hi David,
As it's a demo app, would consider refactoring the code to have a kind of master page that would contain navigation bar?
Indeed, it shouldn't be necessary to include the nav bar in each page.
I'm new to XAML/maui and don't know how it can be implemented.
Thanks.
thanks for providing this sample here.
after a manual "update-pacakge" i was able to resolve all nuget package references.
when i want to build i get the following error:
WMC1007 Cannot resolve metadata for WinUI types. Please ensure that Nuget Restore was successful. WeatherTwentyOne C:\source_prototypes\WeatherTwentyOne-dev-rc\src\WeatherTwentyOne\WeatherTwentyOne.csproj 1
i tried: clean, rebuild, reload project
For desktop add a rollover. For mobile a pressed highlight.
Hello, having trouble setting up MAUI on MacOS.
I don't wan't t install whole Android SDK (not interested really).
maui-check
ran fine for me, excluding Android SDK.
Could you please introduce manual for MacOS either Visual Studio or Visual Studio Code?
Add interactive selection on Settings and toggle units on all screens
The above method does not cause any change to the app. Upon debugging I noticed that the window handle Hwnd
is always IntPtr.Zero
. I was able to to however make it work with the below code :-
.
.
Hwnd = ((MauiWinUIWindow)App.Current.Windows[0].Handler.PlatformView).WindowHandle;
.
.
Is it the correct way or am I missing something here? All my setup are according to the latest official docs.
Add text labels to the navigation buttons.
Incorporate live data into everywhere in the app
Hello, I'm using visual studio 2022 preview 1 with .net maui preview 5 , this app crashes after few seconds on first open. Same happens from both emulator and my android device. Didn't tested ios yet. Here's the error getting in vs debugger
[] * Assertion at /__w/1/s/src/mono/mono/mini/debugger-engine.c:1088, condition `found_sp' not met
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 24673 (.NET ThreadPool)
I cloned the repo then launch the application on multiple emulators (IPhone Pro 12, IPhone 12) and on my own device (IPhone 11 Pro) and the application does not render as in the screenshots.
The application does not take the full screen as the following pictures shows.
I'm on Mac and I'm using this command to launch the application:
dotnet build -t:Run -f net6.0-ios -p:_DeviceName=:v2:udid=<UDID>
// My own device
dotnet build -t:Run -f net6.0-ios -r ios-arm64 -p:_DeviceName=<UDID>
Need a consistent looking Entry and to add the filtering logic
If I clone the repo (as of the time of this issue), and I open it up in Visual Studio 2022 17.1.0 Preview 3
, with maui-check executed and passed, I get The name <yada yada> does not exist in the current context
for any class that has an InitializeComponent method, including App.xaml.cs
UPDATE
"Build succeeded"
Error CS0103
The name 'InitializeComponent' does not exist in the current context
WeatherTwentyOne (net6.0-android), WeatherTwentyOne (net6.0-ios), WeatherTwentyOne (net6.0-maccatalyst), WeatherTwentyOne (net6.0-windows10.0.19041)
C:\Git\Maui\WeatherTwentyOne\src\WeatherTwentyOne\Pages\FavoritesPage.xaml.cs 9 Active
Error CS0103 The name 'InitializeComponent' does not exist in the current context
WeatherTwentyOne (net6.0-android), WeatherTwentyOne (net6.0-ios), WeatherTwentyOne (net6.0-maccatalyst), WeatherTwentyOne (net6.0-windows10.0.19041)
C:\Git\Maui\WeatherTwentyOne\src\WeatherTwentyOne\Views\CurrentWidget.xaml.cs 7 Active
Error CS0103 The name 'InitializeComponent' does not exist in the current context
WeatherTwentyOne (net6.0-android), WeatherTwentyOne (net6.0-ios), WeatherTwentyOne (net6.0-maccatalyst), WeatherTwentyOne (net6.0-windows10.0.19041)
C:\Git\Maui\WeatherTwentyOne\src\WeatherTwentyOne\Views\WidgetsPanel.xaml.cs 7 Active
Error CS0103 The name 'PhoneTabs' does not exist in the current context
WeatherTwentyOne (net6.0-android), WeatherTwentyOne (net6.0-ios), WeatherTwentyOne (net6.0-maccatalyst), WeatherTwentyOne (net6.0-windows10.0.19041)
C:\Git\Maui\WeatherTwentyOne\src\WeatherTwentyOne\App.xaml.cs 14 Active
This is the log of maui-check:
βΌ .NET MAUI Check v0.10.0.0 βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
This tool will attempt to evaluate your .NET MAUI development environment.
If problems are detected, this tool may offer the option to try and fix them for you, or suggest a way to fix them
yourself.
Thanks for choosing .NET MAUI!
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Β» Synchronizing configuration... ok
Β» Scheduling appointments... ok
> OpenJDK 11.0 Checkup...
- 11.0.12 (C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\bin\..)
- 1.8.0-25 (C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25)
> Visual Studio 17.1.0-pre.3.0 Checkup...
- 17.0.0
- 17.1.0-pre.3.0 - C:\Program Files\Microsoft Visual Studio\2022\Preview
- 16.11.1
> Android SDK Checkup...
- emulator (31.1.4)
- build-tools;31.0.0 (31.0.0)
- platforms;android-31 (1)
- system-images;android-31;google_apis;x86_64 (8)
- platform-tools (31.0.3)
- cmdline-tools;5.0 (5.0)
> Android Emulator Checkup...
- Emulator: pixel_2_pie_9_0_-_api_28 found.
> .NET SDK Checkup...
- 3.1.300 - C:\Program Files\dotnet\sdk\3.1.300
- 5.0.400 - C:\Program Files\dotnet\sdk\5.0.400
- 6.0.100-preview.3.21202.5 - C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5
- 6.0.100 - C:\Program Files\dotnet\sdk\6.0.100
- 6.0.200-preview.22055.15 - C:\Program Files\dotnet\sdk\6.0.200-preview.22055.15
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΌ Recommendation: Download .NET SDK (6.0.200)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
I did not download .NET SDK (6.0.200).
After I updated the csproj file and removed the ItemSizingStrategy="MeasureFirstItem" from the CollectionView in WidgetsPanel (because ItemSizingStrategy causes the Android version to exit on startup), I noticed the Flyout only shows the Settings Icon on Windows and Android.
With some fiddling around with Styles and VisualStateManager, I could get the FlyoutItems to appear on the Windows version. However I was never able to get them to show on the Android.
I tested the Android app on a Galaxy Tab S7.
When I try to run the app using Visual Studio 2019 16.11 Preview 2, I get the error below. What's the issue with MyGet?
Failed to restore G:\files\WeatherTwentyOne-main\WeatherTwentyOne-main\src\WeatherTwentyOne\WeatherTwentyOne.csproj (in 2 ms).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.Toolkit.Uwp.Notifications'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.ProjectReunion.WinUI'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.Maui'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.User32'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.ProjectReunion'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.ProjectReunion.Foundation'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.ProjectReunion.WinUI'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.Toolkit.Uwp.Notifications'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.Maui'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.User32'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.ProjectReunion'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Microsoft.ProjectReunion.Foundation'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.Kernel32'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.Windows.Core'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.Windows.ShellScalingApi'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Validation'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.Kernel32'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.Windows.Core'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='PInvoke.Windows.ShellScalingApi'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
Retrying 'FindPackagesByIdAsyncCore' for source 'http://api.myget.org/FindPackagesById()?id='Validation'&semVerLevel=2.0.0'.
Response status code does not indicate success: 404 (Not Found).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
1>------ Rebuild All started: Project: WeatherTwentyOne.WinUI, Configuration: Debug Any CPU ------
2>------ Rebuild All started: Project: WeatherTwentyOne, Configuration: Debug Any CPU ------
Error occurred while restoring NuGet packages: Failed to retrieve information about 'PInvoke.Windows.ShellScalingApi' from remote source 'http://api.myget.org/FindPackagesById()?id='PInvoke.Windows.ShellScalingApi'&semVerLevel=2.0.0'.
2>C:\Program Files\dotnet\sdk\6.0.100-preview.5.21302.13\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(33,5): error NETSDK1147: To build this project, the following workloads must be installed: microsoft-android-sdk-full
2>C:\Program Files\dotnet\sdk\6.0.100-preview.5.21302.13\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(33,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload install microsoft-android-sdk-full
2>Done building project "WeatherTwentyOne.csproj" -- FAILED.
hi I'm somewhat newbie to maui and blazor -shell
I'm trying to open this repo with both vs 2019 and 2022 preview but no luck errors arise from both consoles output .
I installed all workloads unfortunately VS19 doesn't have MAUI component nor .net 6 even after update ... I tried to force installment using CLI it's says it has installed but it seems doesn't I've already installed multiple versions of .net 6 and all workloads ,some plugins but errors of vs2019 :
Severity Code Description Project File Line Suppression State Error Improper project configuration: no AppxManifest is specified, but WindowsPackageType is not set to MSIX. WeatherTwentyOne.WinUI
also doesn't detect .net 6 sdk and maui installed through cli
Severity Code Description Project File Line Suppression State Error NU1012 Platform version is not present for one or more target frameworks, even though they have specified a platform: net6.0-android, net6.0-ios, net6.0-maccatalyst WeatherTwentyOne C:\Users\hi\Desktop\demo\MAUI\src\WeatherTwentyOne\WeatherTwentyOne.csproj 1
Severity Code Description Project File Line Suppression State Error NETSDK1045 The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. WeatherTwentyOne.WinUI C:\Program Files\dotnet\sdk\5.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 141
I spent some time installing 2022 with all required workloads and followed the installment instructions ;
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.FileSystemEnumerator
1[[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.FileSystemEnumerable
1.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.FileSystemEnumerable
1[[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(Func
2 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.ViewHandler
2[[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.ViewHandler
2[[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.PropertyMapper
2.<>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_os_Bundle_(IntPtr
I can build WinUI3 successfully, but when I launch it with debug, I got the following exception:
System.Reflection.TargetInvocationException
HResult=0x80131604
Message=Exception has been thrown by the target of an invocation.
Source=System.Private.CoreLib
StackTrace:
at System.RuntimeType.CreateInstanceOfT()
at System.Activator.CreateInstance[T]()
at WinRT.WeakLazy`1.get_Value()
at Microsoft.UI.Xaml.Application._IApplicationStatics.get_Instance()
at Microsoft.UI.Xaml.Application.Start(ApplicationInitializationCallback callback)
at WeatherTwentyOne.WinUI.Program.Main(String[] args) in C:\Users\wangq\development\WeatherTwentyOne\src\WeatherTwentyOne.WinUI3\obj\x64\Debug\net6.0-windows10.0.19041\Windows\WindowsApp.g.i.cs:line 26
COMException: Class not registered (0x80040154 (REGDB_E_CLASSNOTREG))
Windows 10 build version: 19042.985
Make it consistent across platforms.
Hide back button or use navigation that doesn't trigger it.
Hello,
I am just wondering why files are duplicated between WeatherTwentyOne and WeatherTwentyOne.WinUI3 projects? I believe it could be a single project containing IOS/Android/MacCatalyst/WinUI3 or am I wrong?
I am new to Maui and I need to create an app where tab visibility depends on the user data/rights. So I began to study this sample project.
I made the following change to App.xml: (added x:Name="tabFav" IsVisible="False"
)
<FlyoutItem Title="Favorites" Icon="tab_favorites.png" x:Name="tabFav" IsVisible="False"> <ShellContent ContentTemplate="{DataTemplate page:FavoritesPage}"/> </FlyoutItem>
and changed in App.xaml.cs:
void TapGestureRecognizer_Tapped(System.Object sender, System.EventArgs e) { Shell.Current.GoToAsync("///settings"); tabFav.IsVisible = !tabFav.IsVisible; }
Setting tabFav to visible works but setting to invisible results in unhandled exception when running app in Windows
Yesterday I tried to help an SO MAUI question where a person tried to pull <TabBar x:Name="PhoneTabs">...
into their own MAUI App class, then work with those elements in App.xaml.cs.
Not surprisingly, they weren't succeeding: They were attempting something that would only work within a Shell PAGE, not the APP.
Seeing this, I suggest that the example might be a more useful starting point if the "page" XAML was a separate class, with its own code behind.
(I would link to the question, but it has been removed. Based on a comment OP made just before removing it, they became upset and thought that I was (criticizing? insulting? not sure) what they attempted. Whereas what I intended to convey is that a) MAUI isn't ready yet to work with, unless one is already an experienced Xamarin Forms developer (who would have understood my comment suggesting they make this code refactoring before continuing), and b) that WeatherTwentyOne example had caused this confusion by making it seem (at first glance, to someone not well-versed in XAML and XF) that these elements were part of the App class, whereas they are actually part of Shell, which is a Page.)
It seems that this sample was not tested at IOS, as all TapGestureRecognizer click were not working at all in IOS. (IPhone)
I have lasted Visual Studio version, VS2022 PRO 17.1.0 Preview 2.0, .
Hello everyone,
sorry about my question, but I got many issues when I tried to run the WeatherTwentyOne project, I missed something for sure... can help? I would like to run for now using Android Platform. Maybe I am confuse, and I should run dotnet commands to update something, not sure...
Severity Code Description Project File Line Suppression State
Error NETSDK1045 The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. WeatherTwentyOne.WinUI C:\Program Files\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 141
Severity Code Description Project File Line Suppression State
Error NETSDK1139 The target platform identifier android was not recognized. WeatherTwentyOne C:\Program Files\dotnet\sdk\5.0.400\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 109
See the image:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.