macOS
16 TopicsUnique Device Identifier in MAUI
I am looking for a way to get a device identifier in NET MAUI that is cross platform compliant between Android/iOS/Windows. I originally had this code working in Xamarin Forms with the following: Android Context context = Application.Context; id = Settings.Secure.GetString(context.ContentResolver, Settings.Secure.AndroidId); iOS UIDevice.CurrentDevice.IdentifierForVendor.AsString().Replace("-", ""); Is there anything currently or planned in the future for use in NET MAUI. Thanks In Advance, Stuart Ferguson11KViews3likes1Comment.NET MAUI APP Crashing On MAC Machine and IOs device
.NET MAUI APP runs fine on windows and Android but crashes on Mac Machine and IOs device, is this because the template is in still preview ?, if not kindly help us out with a working sample solution that works on every platform. I am Using Visual Studio for Mac 2022 preview 17.1 and MacOs version is 13 with XCode 13 beta installed .4KViews0likes3CommentsOS versions Supported in dotnet maui
These are the tags used for defining OS version supported by maui app: <SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">15.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">15.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">31.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.19041.0</SupportedOSPlatformVersion> <TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion> But how to define min version and target android version on Android in csproj file. The min version is only defined for windows over here. But not for iOS, Android and Mac. Can someone please explain these lines and how to set the values correctly for each OS.2.5KViews0likes0Commentshow does MAUI handle cross-platform gesture recognition
specifically how is it implemented for each platform and where can i find the code for each platform in regards to this gesture recognition for example, for MacOS i assume there would be some custom NSView implementation with overrides for the following TouchesBeganWithEvent TouchesMovedWithEvent TouchesEndedWithEvent TouchesCancelledWithEvent and for android i assume there would be similar with custom View implementation and OnTouchEvent method override i do not know for windows nor linux as i have not experimented with those platforms yet specifically i assume the gesture API MAUI provides is truely cross-platform and has no platform-dependant behavioural differences (with some exceptions for certain gestures for example a mouse or stylus CANNOT perform a two-finger scroll gesture however would be implemented via the scroll-wheel if present on the mouse on a mobile-device a two-finger scroll gesture does not make sense since it is usually just one finger for scrolling on a trackpad two-finger scrolling makes sense however regardless of HOW it is implemented, the api would provide a platform-independant way of tracking how much the user has scrolled, possibly accounting for some sensitivity setting the user can modify at will similar to pointer-acceleration settings for large and small monitors and high dpi and low dpi monitors2.4KViews0likes2Comments.NET MAUI How to receive process parameters
Hello everyone : When I was researching .NET MAUI, I didn't find an object that can receive process parameters, does anyone know? namespace AutoUpdate.WpfNet6_Sample { /// <summary> /// Interaction logic for App.xaml /// </summary> public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { var args = e.Args; base.OnStartup(e); } } } For example, in wpf, you can get the parameters passed by the process through the args of Onstartup. How to get it in MAUI? like this? protected override Window CreateWindow(IActivationState activationState) { #if WINDOWS var state = activationState as ActivationState; var args1 = state.LaunchActivatedEventArgs; //var args = Environment.GetCommandLineArgs(); return new Window(new MainPage(args1.Arguments)); #endif return null; }2.3KViews0likes0CommentsSource code of .NET Podcasts Sample app
The .NET podcasts is used as sample repo in .NET Conf 2021. I tried to find it's source code but cannot find any link to it. If anyone can, please share the link to the .NET Podcasts source code. As far as I know it is open sourced and is available in public domain.Solved2.1KViews0likes2CommentsBuild error MT0057 for .net Maui iOS, Mac Catalyst builds with no problem
I can build and run for Mac Catalyst fine with this command dotnet build -t:Run -f net6.0-maccatalyst MyApp.csproj but when I try to build for iOS using this command dotnet build -t:Run -f net6.0-ios -p:_DeviceName=:v2:udid=********-************** MyApp.csproj I get this error EXEC : error MT0057: Cannot determine the path to Xcode.app from the sdk root '/Library/Developer/CommandLineTools'. Please specify the full path to the Xcode.app bundle. [/Users/chris/Documents/Development/MyApp/src/MyApp/MyApp.csproj] /usr/local/share/dotnet/sdk/6.0.201/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(897,5): error MSB3073: The command "/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.2.302-preview.14.122/tools/bin/mlaunch --launchsim bin/Debug/net6.0-ios/iossimulator-x64/MyApp.app/ --device :v2:udid=********-************ --stdout /dev/ttys000 --stderr /dev/ttys000 --wait-for-exit" exited with code 1. [/Users/chris/Documents/Development/MyApp/src/MyApp/MyApp.csproj] It is odd that it can find XCode for Catalyst but cannot find it for iOS. Any help would be appreciated.Solved2KViews0likes2CommentsVS Mac 2022 and MAUI status (HotReload and Communication)
I hope we can shortly receive a working HotReload for MAUI on VS Mac 2022 and believe that it should be prioritized highly. HotReload is such an important feature that many developers will not even evaluate or help contribute to the open source development without it. I know this sentiment is even more prevalent among new prospective devs or existing devs using other tech stacks who want to evaluate MAUI (mainly RN or Flutter devs). I move to put the HotReload tooling status on the MAUI roadmap for both platforms here? https://github.com/dotnet/maui/wiki/status. While it may be VS features, it is highly intertwined and developers wanting to evaluate MAUI will look here. There are many developers who will spend the time loading, debugging their installation, only to find that "MAUI doesn't work" or "MAUI is still broken", then return out of frustration. I have more patience than most, but the 4-6 hours I spent debugging VS 2022 on Mac could have been better spent on something else, and would have if the status of HotReload was more prominently displayed. As you know, each failed attempt makes it harder for a return visit for a customer. Please set the expectations before a customer invests time and emotions. I understand and respect the complexity involved in the development of MAUI for multiple platforms. I would also like to help contribute once hot reload is implemented.Solved1.9KViews0likes2CommentsMaui and Grpc cannot work together on MacOS?
Hi, using asp and maui in a single project results in "unsupported" runtime error message. Steps to reproduce: create a standard maui project (from template). remove iOS and Android from TargetFrameworks. Only windows and MacCatalyst shall stay (I want to build a cross platform desktop app). <TargetFrameworks>net6.0-maccatalyst</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks> add grpc nuget reference to the project <PackageReference Include="Grpc.AspNetCore" Version="2.41.0" /> build the project. Following error will be displayed: 1>C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'maccatalyst-x64'. Questions: why I get this error? Isn't grpc supposed to be independent from maui? Grpc itself is supported under Windows, Linux and MacOS. how to fix it?1.4KViews0likes0CommentsVisual Studio 2022 on macOS M1 - compiler failure: application crashes
Hi folks, I installed the latest Visual Studio 2022 preview for M1 Macs and would like toi write a native cocoa app. I created a new Cocoa-App (Mac-App-Xamarin) and just compiled it. But I always get this error / crash message and really didn't find any solution, yet. Anyone who can help me? ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: Cocoa Test [3197] Path: /Users/USER/*/Cocoa Test.app/Contents/MacOS/Cocoa Test Identifier: com.companyname.AppName Version: 1.0 (1) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2022-10-30 19:29:01.2371 +0100 OS Version: macOS 13.0 (22A380) Report Version: 12 Anonymous UUID: 289ADDEB-7896-84E9-45B7-15B9AD808807 Sleep/Wake UUID: 91C3501D-721C-42D6-AA11-D04FBEA02651 Time Awake Since Boot: 6200 seconds Time Since Wake: 6205 seconds System Integrity Protection: enabled Crashed Thread: 0 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace DYLD, Code 1 Library missing Library not loaded: /System/Library/Frameworks/CHIP.framework/Versions/A/CHIP Referenced from: <B59DCE00-7163-32FE-B340-ED3F589BCA27> /Users/USER/*/Cocoa Test.app/Contents/MacOS/Cocoa Test Reason: tried: '/System/Library/Frameworks/CHIP.framework/Versions/A/CHIP' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/Frameworks/CHIP.framework/Versions/A/CHIP' (no such file), '/System/Library/Frameworks/CHIP.framework/Versions/A/CHIP' (no such file, not in dyld cache), '/Library/Frameworks/CHIP.framework/Versions/A/CHIP' (no such file) (terminated at launch; ignore backtrace) I stripped the error message because it's very long.1.2KViews0likes1Comment