locked
Preview: Xamarin.Forms for macOS RRS feed

  • Question

  • User130 posted

    I hope you are taking an opportunity with the latest pre-release 2.3.5.233-pre1 to experience your Xamarin.Forms apps running on macOS. It's a trip.

    We want to kick off a thread to have some ongoing discussion about what's missing, what's not working, and where you'd like to see this go.

    Please keep the discussion here on topic: macOS.

    Wednesday, April 19, 2017 4:50 PM

All replies

  • User1913 posted

    I've started experimenting. It seems to work functionally pretty well. But is looks very ugly.

    Text looks fuzzy.

    Also VerticalTextAlignment="Center" does not seem to work (works/looks fine on iOS):

    <TableView Intent="Settings"> <TableRoot> <TableSection Title="section1"> <ViewCell > <StackLayout Margin="15,0,15,0" Orientation="Horizontal"> <Label Text="Default" VerticalTextAlignment="Center" HorizontalOptions="StartAndExpand" /> <Label TextColor="Gray" x:Name="G1" Text="-" HorizontalOptions="End" VerticalTextAlignment="Center" /> <Label TextColor="Gray" FontAttributes="Bold" Text="-" HorizontalOptions="End" VerticalTextAlignment="Center" /> </StackLayout> </ViewCell> </TableSection> </TableRoot> </TableView>

    But on mac the labels are top aligned

    Friday, April 21, 2017 7:16 PM
  • User211448 posted

    @DavidOrtinau - First of all, thank you and the Xamarin.Forms team very much for this. Many development teams around the world were eagerly waiting for Xamarin.Forms on Mac. Yes we all have seen the release discussion thread but the amount of information & guidance there was very little. Is there a small walk through or guideline on how to add the MAC OS to an existing Visual Studio 2015 multi-platform project ? For example, I got one that is currently implemented for iOS/Droid/UWP.

    Saturday, April 22, 2017 2:50 PM
  • User46181 posted

    This is an amazing accomplishment. I am a long time OS X developer and have been dreaming about this for years. I hope this effort will get Xamarin's full backing and will reach the maturity of the other platforms. I have been playing with it since last night and it is very easy to implement. It seems too good to be true. I only hope that in the future it will be part of the Xamarin.Forms project template. I also hope OS X projects will be part of the Xaml previewer.

    Saturday, April 22, 2017 2:55 PM
  • User46181 posted

    Any ideas how to get text to speech working on OS X in a dependency service? Can't find AVSpeechSynthesizer()

    using System; using AVFoundation; using AVKit;

    using Foundation; using WordGames.OSX;

    [assembly: Xamarin.Forms.Dependency(typeof(TextToSpeechOSX))] namespace WordGames.OSX { public class TextToSpeechOSX : ITextToSpeech { public TextToSpeech_OSX() { }

        public void Speak(string text)
        {
    
            var speechSynthesizer = new AVSpeechSynthesizer();
    
            var speechUtterance = new AVSpeechUtterance(text)
            {
                Rate = AVSpeechUtterance.MaximumSpeechRate / 4,
                Voice = AVSpeechSynthesisVoice.FromLanguage("en-US"),
                Volume = 0.5f,
                PitchMultiplier = 1.0f
            };
    
            speechSynthesizer.SpeakUtterance(speechUtterance);
        }
    }
    

    }

    Sunday, April 23, 2017 1:30 AM
  • User105218 posted

    A few tips for anyone trying to follow the blog tutorial here: https://blog.xamarin.com/preview-bringing-macos-to-xamarin-forms/

    1. Make sure that you right click on the References folder in the Mac project, choose Edit References and switch to the Projects Tab and check the box next to the Xamarin Forms Shared Project. (see attached)
    2. I am getting an error in the Mac project References folder on Xamarin.Mac (See attached) but it still seems to work
    3. Make sure to add the following using directives to AppDelegate.cs in the MacOS project using Xamarin.Forms; using Xamarin.Forms.Platform.MacOS;

    Michael Zaletel Enterprise Mobility @ Productive Edge Xamarin MVP Xamarin Elite Partner




    Friday, April 28, 2017 7:09 PM
  • User58886 posted

    Note that the "Forms App" template in VS.Mac will not work with the instructions to add MacOS to Forms. You will find yourself adding a bunch of other packages to satisfy dependencies and still get build errors even after they are all added.

    If you choose the "Blank Forms App" template, the instructions work as advertised.

    I agree that this is sort of the holy grail of app development for me. If I can write in C# and deploy one standard-ish project for OS X and iOS (and maybe Windows) then I've got everything I want.

    Tuesday, May 2, 2017 11:31 PM
  • User130 posted

    @HalilDoganBolak said: @DavidOrtinau - First of all, thank you and the Xamarin.Forms team very much for this. Many development teams around the world were eagerly waiting for Xamarin.Forms on Mac. Yes we all have seen the release discussion thread but the amount of information & guidance there was very little. Is there a small walk through or guideline on how to add the MAC OS to an existing Visual Studio 2015 multi-platform project ? For example, I got one that is currently implemented for iOS/Droid/UWP.

    Today you cannot add a macOS project in Visual Studio 2015 as it requires a Mac. It's basically the same requirements as a Xamarin.Mac project. https://developer.xamarin.com/guides/mac/gettingstarted/hello,mac/#Requirements

    As we get further along the documentation team will provide some thorough guides. Until then, this feedback helps us know what that guide needs to cover, so thank you!

    Wednesday, May 3, 2017 2:56 PM
  • User130 posted

    @MichaelZaletel thanks for the clarifications. I did have a bullet for "Reference your Xamarin.Forms project (shared or PCL)" but perhaps I should make that more clear. I'll update the post to reference the "using" statements. Good feedback!

    Wednesday, May 3, 2017 2:59 PM
  • User130 posted

    @JohnnieOdom thx, we'll be reviewing the existing project templates and adding new templates to support macOS.

    Wednesday, May 3, 2017 3:09 PM
  • User319610 posted

    Hi, I've just followed the instructions in the blog post and I can't build the result. I am using VS Mac Preview.

    When I use a 'Blank Forms App' with a shared project I see the following error:

    Line 5 of App.xaml.cs in my shared project. public partial class App : Application The type 'System.ComponentModel.INotifyPropertyChanged' is defined in an assembly that is not referenced. ...

    When I use a 'Blank Forms App' with a Portable Class Library I see the same error but on the line

    LoadApplication(new App())

    in the DidFinishLaunching override in my MacOS project.

    I can't find the System.ObjectModel assembly in the references editor.

    I have tried adding a reference to the System.ObjectModel assembly from

    /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Facades

    this causes a new warning regarding assembly version mismatch which suggests adding the tag in the project file. Having added this tag the warning is removed but the error persists.

    Any suggestions as to how to fix this?

    Saturday, May 6, 2017 8:52 AM
  • User276316 posted

    First off, I'm beyond excited by this announcement. I've been waiting literally for years for it. Thank you for making my day!

    However, I'm a bit confused... Xamarin.Forms iOS apps need a Mac to develop iOS apps yet can be developed on Windows (using remote build) - why is the macOS version different? Couldn't the same tooling in VS be used for that? I'm working on an app/application for Windows, Windows UWP, iOS and Android - and very much want to add MacOS to that - but being obligated to do that on a Mac really messes up my development process.

    I can see an argument that with native macOS Xamarin development you really do need to have access to the IB part of XCode.. but you don't for Forms... and this is Forms, not pure native.

    So.. long question short: any chance that if this gets to be more widely used, the tooling changes needed to make Xamarin.Forms/macOS building on Windows via remote building might happen?

    Wednesday, May 10, 2017 9:35 PM
  • User276316 posted

    One omission that in retrospect is kind of obvious given where Forms comes from... but it's kind of important:

    Nothing like a <Menu> and <MenuItem> object. Obviously not needed for mobile apps.. but... this is a desktop environment. I know you can do it procedurally.. but it's an odd disconnect.

    For people getting the missing Xamarin.Mac assembly, I don't know why - but I'm finding in the most recent install of VSMac, this happens by default. it's easy to fix: remove Xamarin.Mac from the references list, then add it back. That seems to fix it.

    Christopher Hall, have you added the Xamarin.Forms nuget package to your Forms.mac project (the one you just created)? Not having it included would cause the problems you're describing. If you're using a shared/portable library to hold your common code (which is the norm), you also have to put a reference to that in the Forms.mac project. Also check the Xamarin.Mac assembly and see if it's got the red x of death next to it. If it does, delete the reference and add it back in from the Assemblies tab.

    Thursday, May 11, 2017 6:08 PM
  • User299957 posted

    Which is the status of this module?

    Monday, June 12, 2017 10:42 AM
  • User263 posted

    Will Xamarin.Forms for macOS support .NET standard? Reading this below had me a little worried...

    Not All NuGets are Ready for macOS In order to work in a macOS project, packages must target xamarinmac20. You may find that some of your beloved libraries do not yet support macOS. What can you do? Kindly send a request to the project’s maintainer to add it. Until they have support, you may need to look for alternatives.

    Eg. I raised this with James Newton-King for Newtonsoft.Json, and they have instead targeted .NET standard and would not be adding support for xamarinmac20.

    Thursday, June 15, 2017 1:26 PM
  • User2496 posted

    @Velocity yap we are going to support when netstandard hits 2.0 we hope

    Wednesday, June 21, 2017 2:22 PM
  • User263 posted

    @rmarinho Thanks Rui - I guess this is an important requirement if the platform is to become production-ready. We are eager to adopt Xamarin.Forms for macOS, but have dependencies on packages like Newtonsoft.Json. Hopefully the timeline for this isn't too far out!

    Tuesday, June 27, 2017 8:01 AM
  • User79962 posted

    Hey David (@DavidOrtinau), Thanks for releasing this awesome feature, I have a small query, currently I can have only one window open in the application at a time, Is it possible to support multiple windows. I apologize if the question is very basic as I am pretty new to Xamarin.Mac development and there is no classes in Xamarin University on this.

    Tuesday, July 18, 2017 6:56 PM
  • User99157 posted

    I assume there is no xaml previewer yet for macOS? Trying to build a new app with xamarin.forms (for the sole sake of not needing to screw with XCode) and it's a bit tedious without having a live previewer.

    Wednesday, July 19, 2017 4:14 PM
  • User130 posted

    @SRaviKumar we don't have a method within Xamarin.Forms currently to launch additional Windows. It should work using the same code/pattern you would use with Xamarin.Mac.

    https://developer.xamarin.com/guides/mac/user-interface/working-with-windows/

    Presently this would mean creating 2 Xamarin.Forms app instances which isn't what I think you'd want, so we have work to do here.

    Thursday, July 20, 2017 9:39 PM
  • User130 posted

    @RobertHoward no XAML Previewer support, that's correct.

    Thursday, July 20, 2017 9:42 PM
  • User53128 posted

    I'm just starting out looking at this stuff. I've done Xamarin stuff for Droid and iOS before so I'm not a complete Xamarin noob but the number of inconsistencies, general weirdness and foibles I'm encountering trying to get started with this is nothing short of profound.

    I've been following these two guides for using Xamarin.Forms with .NetStandard to target MacOS.

    https://blog.xamarin.com/building-xamarin-forms-apps-net-standard/

    https://blog.xamarin.com/preview-bringing-macos-to-xamarin-forms/

    I've not gotten far at all, I'm just trying to get the projects setup in Visual Studio for Mac. These blog posts I linked to above make this all sound like it works and is very simple. My experience has thus far been the polar opposite of this.

    I created a Blank Forms App rather than a Forms App as for some reason the Forms App insists I also want a WebAPI project, which I really don't.

    After creating this I created a .NETStandard project in order to pull over the XAML files as directed inthe blog posts and now this project insists on showing every file is duplicated with only one showing the *.cs file being associated with it.

    After trying to fix this and breaking the solutions a few times I managed to get to a point where the files were listed and I wasn't getting the DuplicateCompile Items exceptions on build.

    Now the only build problem I have is:

    "Error CS0103: The name 'InitializeComponent' does not exist in the current context (CS0103) (Oracle.UI)"

    The entire .CS files is:

    using Xamarin.Forms;
    
    namespace Oracle
    {
        public partial class OraclePage : ContentPage
        {
            public OraclePage()
            {
                InitializeComponent();
            }
        }
    }
    

    I've tried the obvious fix of matching up the XAML x:class="" declaration but this has no effect at all. I've gone through the .NETSTandard blog post time and time again and as far as I can tell I haven't missed anything out yet for me this results in a very broken experience and a project that wont even compile.

    I'm referencing the very latest pre-release of Xamarin.Forms in my .NetStandard project. 2.3.5.256-pre6.

    Sunday, July 23, 2017 12:37 PM
  • User53128 posted

    I've gotten a bit further with this but I'm now having a different issue. I've gotten a solution with a NetStandard Xamarin Forms project and a Cocoa App using Forms.

    However, when I compile the application I'm getting the following error:

    Error MM0023: Application name 'Oracle.exe' conflicts with another user assembly. (MM0023) (Oracle.MacOS)
    

    My Forms project and namespace is Oracle. If I change this to something like Oracle.UI and update all the namespaces in the classes the MacOS application refuses to recognise the App class from the Oracle solution.

    I'm stuck swapping between the error above and this error:

    Error CS0234: The type or namespace name 'App' does not exist in the namespace 'Oracle' (are you missing an assembly reference?) (CS0234) (Oracle.MacOS)

    Not sure how to move this forward.

    I'm assuming the issue with that there is an Oracle.dll and an Oracle.exe but I don't know what to do to fix this issue.

    Monday, July 24, 2017 6:44 PM
  • User53128 posted

    Bump, does anyone have any info on a potential fix for this?

    Wednesday, July 26, 2017 6:13 PM
  • User2496 posted

    Seems a namespace or dll conflit, can you post a link to the project so we take a look?

    Thanks

    Thursday, July 27, 2017 3:47 PM
  • User53128 posted

    Hi Marinho,

    You cat get the project here:

    https://github.com/jamsoft/Oracle

    Saturday, July 29, 2017 9:27 AM
  • User117265 posted

    Mac builds can pick between two Target Frameworks (see Options->Build->General) a) Xamarin.Mac Modern b) Xamarin.Mac Full

    Is Xamarin Forms for Mac OS supposed to work with both frameworks? I can only get it working with Xamarin.Mac Modern.

    If the target is 'Full' then I have error in AppDelegate.cs AppDelegate.cs(30,30): Error CS0234: The type or namespace name 'MacOS' does not exist in the namespace 'Xamarin.Forms.Platform' (are you missing an assembly reference?) (CS0234)

    I'd be happy with 'Modern' except some of the Nugets I use (like NLog or Xam Plugins Gelocation) do not install in 'Modern' and wondered if I had missed something before trying to build Nlog myself.

    Thanks

    Monday, August 7, 2017 2:41 PM
  • User117265 posted

    I noticed that MacOS Xamarin Forms is calling 'OnSleep' and 'OnResume' when the desktop window loses and gains the Focus. This is no good for me as I want to keep the application running while I do other things on the Mac (like interact with the IDE or the command line)

    Is there an official way to stop these events?

    For now I've used #if ... #endif to ignore the event (although I could have used a runtime platform test)

      public void OnSleep() {
          // Ignore OnSleep with MacOS desktop applications
          #if __MACOS__
              return;
          #endif
          HandleOnSleep();
      }
    

    and define MACOS in the Project settings

    Monday, August 7, 2017 4:58 PM
  • User117265 posted

    After reading more on the topic it looks like Xamarin Forms just targets xamarinmac20 which is the Xamarin.Mac Modern target.

    Monday, August 7, 2017 8:04 PM
  • User339045 posted

    @DavidOrtinau Thank you for working on Xamarin Forms for Mac. We are in the midst of a cross platform proof-of-concept where we would like to show Xamarin Forms for Mac. We are in a situation where we need to interop to a 3rd party library which is 32-bit. Unfortunately, the preview of Xamarin Forms does not work when we change the architecture from x8664 to i386. Is there a plan for a preview that will support both the i386 and x8664 architecture?

    I have attached a sample "Hello Forms" application which demonstrates the issue.

    Wednesday, August 9, 2017 6:50 PM
  • User330221 posted

    Hi! I am also trying to use Xamarin.Forms for Mac! I took this manual: https://blog.xamarin.com/preview-bringing-macos-to-xamarin-forms/

    and when I start my app in debug mode everything runs fine. But when I want to create a release build I get this error:

    Build FAILED.

    /Users/xyz-mann/Projects/MacTest/MacTest/obj/x86/Release/mmp-cache/registrar.m(6277,11): warning GD811092D: duplicate protocol definition of 'WebResourceLoadDelegate' is ignored /Users/xyz-mann/Projects/MacTest/MacTest/obj/x86/Release/mmp-cache/registrar.m(6496,11): warning GD811092D: duplicate protocol definition of 'CALayerDelegate' is ignored /Users/xyz-mann/Projects/MacTest/MacTest/obj/x86/Release/mmp-cache/registrar.m(8691,2): warning GB7F1753F: method possibly missing a [super splitView:effectiveRect:forDrawnRect:ofDividerAtIndex:] call [-Wobjc-missing-super-calls] /Users/xyz-mann/Projects/MacTest/MacTest/obj/x86/Release/mmp-cache/registrar.m(6637,1): error G0BB64AFA: duplicate interface definition for class 'NSToolbarItemGroup'

    And I can't access Main.Storyboard cause of this error:

    Multiple types (NSToolbarItemGroup and AppKit.NSToolbarItemGroup) registered with the same Objective-C name: NSToolbarItemGroup

    note this also happen in a blank new app as soon as I am going to install Xamarin.Forms nugget pack

    Maybe someone else also have this problem and can help me? or is it known and will be fixed?

    thanks!

    Thursday, August 10, 2017 12:03 PM
  • User117265 posted

    I also have the same problem. MMP: Error MM4116: Could not register the assembly 'Xamarin.Forms.Platform.macOS': error MM4118: Cannot register two managed types ('NSToolbarItemGroup, Xamarin.Forms.Platform.macOS' and 'AppKit.NSToolbarItemGroup, Xamarin.Mac') with the same native name ('NSToolbarItemGroup'). (MM4116)

    Sunday, August 13, 2017 6:39 AM
  • User32853 posted

    I created a PR for this bug, https://github.com/xamarin/Xamarin.Forms/pull/1097. But you don't need the storyboard at all, if you want to use Forms on the Mac.

    Monday, August 14, 2017 12:09 PM
  • User237248 posted

    Also seeing the same duplicate symbol error. Are any of you using a .NET Standard libraries with Forms by any chance? I am, and just wondering if that's affecting it.

    EDIT: Nope, tried with a shared project but with same results. I'm using VS4Mac with beta channel, so I guess that could also be related?

    Monday, August 14, 2017 2:03 PM
  • User117265 posted

    Found a bug with DisplayActionSheet on XF for MacOS. If the list is long then the pop-up does not have any scroll bars to show the whole list of items and no way to reach the Cancel button at the bottom of the popup

    Tuesday, August 15, 2017 3:48 PM
  • User117265 posted

    Bug 58779 has been filed for the DisplayActionSheet bug (when the list has 15 items and is taller than the screen height)

    I will add that I've now ported 2 Xamarin Forms applications to Xamarin Forms on the Mac. Both have custom renders which I ported over too. It is wonderful.

    Tuesday, August 15, 2017 4:49 PM
  • User130 posted

    Thanks all for the feedback and helping hammer through these issues.

    Lots of macOS related fixes including the PR1097 are now available in 2.4.0-pre1. Update and continue to let us know how you get on.

    Thursday, August 17, 2017 12:36 AM
  • User117265 posted

    Found another bug. I use XF Properties classes to save and load user settings. Properties are serialised into a file called PropertyStore.forms which should be in IsolatedStorage.

    However on my Mac desktop, the file is located at /Users/myname/.config/.issolated_storage/PropertyStore.forms

    Two different XF Mac OS Desktop apps are accessing the same file and conflicting. Something is wrong as the properties are not in sub-directories that are app specific (so not really IsolatedStorage)

    Friday, August 18, 2017 11:35 AM
  • User276316 posted

    First off, I'm porting a utility from Windows desktop WPF to MacOS using Forms MacOS and overall, it's been amazingly simple to make everything work and this is so much nicer and easier to do than ObjC.

    BUT! (You knew there was a but coming)... There are a bunch of really odd problems. I'll dump them all here in a list but I can also post them on the GitHub. I'm using 2.4 pre 1

    1. I have a fairly simple ListView that's bound to a List<FileRow> where FileRow is just an object with four properties. It loads nicely, but on scrolling, it crashes with an "OutOfRange" error on "index". I've tried it with CachingStrategy set to Recycle and Retain. Both crash. The contents of the List doesn't change once loaded. There are only 89 items in the list.
    2. The buttons are... strange. They don't look like native MacOS buttons. Worse, someone added lines to the right and bottom to make them look kinda 3D, but you can't get rid of them. Even setting BorderColor to transparent doesn't help.
    3. My main window (well, my only window) is a tabbed page. The first page is a grid with three sections, two fixed (top and bottom) and the middle variable (height="*"). On loadup, the content isn't sized to the window, so the bottom section isn't visible as it's below the window. Resizing fixes this.
    4. There's no way to modify the menu bar. I've tried EVERYTHING including going to the Appkit directly and fiddling with it. There's also no way to create a menu bar attached to the window "Windows Style". Mac apps without menu bars are... exceptionally bizarre to use. I can create my own control that simulates a menu bar in the window, but that's very unMac-Like.
    5. No way to quit from the keyboard... or use any keyboard shortcuts as far as I can see.
    6. No way to maximise a window. The yellow dot is always greyed out.
    Saturday, September 2, 2017 10:39 PM
  • User276316 posted

    First off, thank you for Xamarin.Forms MacOS. I've waited a long time for this day. :) Don't take the following as general criticism - Forms for Mac even now in a prerelease state is pretty amazing.

    However, a few problems. I'm using version 2.4 pre 1. I'm porting an app I wrote in Windows WPF over to MacOS. I won't go on about the arbitrary changes in naming conventions between WPF and Forms, I'm sure you've heard it a thousand times, but it is pretty annoying.

    1. Buttons are still pretty awful. They don't look like MacOS buttons. Worse, someone added a solid bar to the right and the bottom to give it a 3D-ish look and if you make the button transparent, they don't go away. Setting BorderColor transparent doesn't help either.
    2. I have a ListView bound to a List<FileRow> where FileRow is a simple class with four properties in it. There are 89 items in the list. They show correctly in the ListView, but scrolling will cause an OutOfBounds exception to be thrown on 'index'. I've tried setting the Caching Strategy to Recycle and Retain - both fail in the same way. The ItemTemplate is just a ViewCell containing a Grid and some Labels. The list doesn't change content once loaded.
    3. There's no way to modify the menu bar. MacOS apps without a menu bar are very strange things. I've tried everything even going down to native calls in AppKit and trying to modify the storyboard. Nothing works. There's no window specific menu bar either (a la Windows), and I could create my own controls for this.. but window specific menu bars are generally unknown in MacOS land.
    4. There doesn't seem to be any keyboard shortcuts at all. Not even the standard ones like command-Q and command-X V Z or Y. This may be because there's no menu bar, but it's kind of annoying.
    5. My window is a TabbedPage and it contains two ContentPages. The first one contains a Grid with three rows: two fixed height sections (top and bottom) and one variable (middle - height="*"). On load up, the contents render off the bottom of the window, hiding the third section. A resize of the window causes a rerender and it is ok then.
    Saturday, September 2, 2017 11:14 PM
  • User311 posted

    @JeffLewis: I think there is some progress going on in the desktop-support branch, menu's (main menu bar and context menu's) seem to be have been implemented in Core and MacOS: https://github.com/xamarin/Xamarin.Forms/commit/3c46b9c593eb5c6b69c1d590aabcac3a5ae634b4

    Sunday, September 3, 2017 8:22 AM
  • User276316 posted

    @rogihee said: @JeffLewis: I think there is some progress going on in the desktop-support branch, menu's (main menu bar and context menu's) seem to be have been implemented in Core and MacOS: https://github.com/xamarin/Xamarin.Forms/commit/3c46b9c593eb5c6b69c1d590aabcac3a5ae634b4

    Thank you for the pointer, Rogier. I've actually been writing in bits of AppKit code into my Forms app to handle catching keyboard events so I can at least get the shortcuts going.

    Additional info on the ListView problem, it seems that if I refresh the list - even with the exact same data, the problem goes away, which is odd. It suggests there's an initialisation problem in the ListView class.

    Sunday, September 3, 2017 7:43 PM
  • User117265 posted

    My Pull Request to fix the important MacOS bug in DisplayActionSheet has been merged into the XamarinForms source on GitHub (the one where it could not handle long lists). The order of the list is still in reverse order to iOS and Android but I can live with that for now.

    It is really handy having the full source to Xamarin Forms on GitHub along with a project to test the GUI. Would have been stuck without it.

    Monday, September 4, 2017 9:36 AM
  • User327473 posted

    Nice news! Android again pleases all its customers, a new Oreo came out so let's see a review of this miracle: https://www.cleveroad.com/blog/android-8-0-features-and-updates-release-of-new-android-os I also suggest to recall not a long but very interesting history of this operating system: https://en.wikipedia.org/wiki/Android(operatingsystem)

    Monday, September 4, 2017 11:04 AM
  • User57869 posted

    After solving some problems I can compile at last. Unfortunately now I get an exception on startup.

    System.TypeLoadException: Could not resolve type with token 01000120 (from typeref, class/assembly System.Drawing.RectangleF, Xamarin.Mac, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065) at Xamarin.Forms.Platform.MacOS.VisualElementTracker.OnUpdateNativeControl (CoreAnimation.CALayer caLayer) [0x001f4] in <2d9ebed16df2477bbf17b5b8974ffe3d>:0 at Xamarin.Forms.Platform.MacOS.VisualElementTracker.UpdateNativeControl () [0x00038] in <2d9ebed16df2477bbf17b5b8974ffe3d>:0 ... at Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.SetMainPage () [0x00000] in <2d9ebed16df2477bbf17b5b8974ffe3d>:0 at Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00041] in <2d9ebed16df2477bbf17b5b8974ffe3d>:0 at GestureSample.MacOS.AppDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00013] in /Users/Michael/Documents/dev/GestureSample_Git/GestureSample/GestureSample.MacOS/AppDelegate.cs:31

    I have the alpha channel in VS Mac (Version 7.2 Preview (7.2 build 634)), Xamarin.Mac 3.8.0.49 and XF 2.4.0.280.

    This is my first try in VS Mac. I usually work in VS for Windows. So I may miss something which is obvious for everybody else.

    Tuesday, October 3, 2017 6:07 PM
  • User57869 posted

    I changed a ton of things, but I think the problem was a reference to System.Drawing in my Mac project. No idea where that came from. I didn't use System.Drawing.RectangleF or any other type from that dll myself.

    Thursday, October 5, 2017 4:24 PM
  • User57869 posted

    So up to the next problem.

    @DavidOrtinau , you wrote in your blog post that NuGet package authors must target xamarinmac20 in order to get installed to the mac project. How exactly do I do that?

    I wrote in my .nuspec:

    <file src="..\MR.Gestures.MacOS\bin\Release\MR.Gestures.MacOS.dll" target="lib\xamarinmac20" />
    <file src="..\MR.Gestures\bin\Release\MR.Gestures.dll" target="lib\xamarinmac20" />
    <file src="..\MR.Gestures\bin\Release\MR.Gestures.XML" target="lib\xamarinmac20" />
    

    I also tried lib\Xamarin.Mac like you used in your own Xamarin.Forms.nuspec. Both versions add the files to the .nupkg file in the respective folder, but when I try to install the package to the macOS project, only the reference to MR.Gestures.dll (the PCL project) is added, but not MR.Gestures.MacOS.dll. The file MR.Gestures.XML is also copied to the target folder.

    What else do I have to do for this .dll to be deployed to my macOS project?

    Thursday, October 5, 2017 4:54 PM
  • User57869 posted

    Another problem that I have is with compiling only on the Mac.

    My MR.Gestures solution has a project for every platform - from Windows Phone 8 Silverlight up to macOS. But I can't compile the whole solution anymore. If I want to make a NuGet package, I have to compile the macOS project on the Mac, copy the dll over to Windows, then compile the rest and run NuGet.exe pack there.

    I do understand that you won't add tooling support for WinPhone 8 and Windows Runtime anymore to VS for Mac, but macOS and UWP (and all others) should be compilable on one platform.

    Friday, October 6, 2017 7:45 AM
  • User57869 posted

    I may be doing something out of the ordinary here, but I used a NavigationPage and PushAsync to switch to another ContentPage. The content of the second page is not displayed. Just the header and Title are changed. Filed bug 60021.

    Friday, October 6, 2017 1:54 PM
  • User57869 posted

    The Mac has its 0/0 coordinates at the LOWER left corner. Everybody else on earth has 0/0 at the top left.

    This makes platform independent code using AbsoluteLayout, RelativeLayout, TranslationY or AnchorY impossible. As XF wants to be a cross platform framework, you should flip the coordinates.

    As I see it every view needs to return true from its IsFlipped property. That would mean that every renderer needs to override that property and every other views which will be shown too. I hope there's an easier way to do this. That would be quite some effort.

    Thursday, October 12, 2017 3:25 PM
  • User57869 posted

    Next one:

    I have a NavigationPage, push a TabbedPage and when I try to go back and close the TabbedPage, the app crashes with this exception:

    [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'TabbedPageRenderer'. at Foundation.NSObject.getSuperHandle () [0x00021] in /Users/builder/data/lanes/5489/697f665b/source/xamarin-macios/src/Foundation/NSObject2.cs:416 at AppKit.NSViewController.getView () [0x00030] in /Users/builder/data/lanes/5489/697f665b/source/xamarin-macios/src/build/mac/mobile/AppKit/NSViewController.g.cs:1147 at Xamarin.Forms.Platform.MacOS.TabbedPageRenderer.getNativeView () [0x00000] in :0 at Xamarin.Forms.Platform.MacOS.Platform.DisposeRendererAndChildren (Xamarin.Forms.Platform.MacOS.IVisualElementRenderer rendererToRemove) [0x0002a] in :0 at Xamarin.Forms.Platform.MacOS.NavigationPageRenderer+<>cDisplayClass440.b0 () [0x00000] in :0 at Xamarin.Forms.Platform.MacOS.NSViewControllerExtensions+<>cDisplayClass00`1[T].b0 () [0x0001b] in :0 at ObjCRuntime.Trampolines+SDAction.Invoke (System.IntPtr block) [0x0001b] in /Users/builder/data/lanes/5489/697f665b/source/xamarin-macios/src/build/mac/mobile/ObjCRuntime/Trampolines.g.cs:10623 at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[]) at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /Users/builder/data/lanes/5489/697f665b/source/xamarin-macios/src/AppKit/NSApplication.cs:100 at GestureSample.MacOS.MainClass.Main (System.String[] args) [0x00017] in /Users/Michael/Documents/dev/GestureSampleVS/GestureSample/GestureSample.MacOS/Main.cs:11

    Friday, October 13, 2017 9:37 AM
  • User313806 posted

    Hello !

    First of all: thanks for porting Forms on Mac ! Great work. But for my app, I really need "ScrollTo" for my ListView... It seems that this is not implemented. Question: when di you plan to implement the "ScrollTo" ?

    Thanks

    Pierre

    Saturday, October 21, 2017 9:09 AM
  • User313806 posted

    Another question: is there a device (like "iOS") that I can use in my XAML file with "OnPlatform" for MacOS in order to detect that I'm or not on this platform ? I didn't find it...

    Pierre

    Friday, October 27, 2017 9:16 PM
  • User57869 posted

    I filed a couple of bugs:

    • 60510: [MacOS] Stepper wraps from Minimum to Maximum and vice versa
    • 60511: Slider.Minimum > 0 crashes
    • 60512: Slider: circle is not at the right position
    • 60513: [MacOS] TimePicker raises PropertyChanged before it changes Time
    • 60515: [MacOS] closing a TabbedPage crashes with an ObjectDisposedException
    • 60516: [MacOS] cannot focus an EntryCell

    I can only file 2 bugs within 16 minutes. If you want to protect from spam, then you should probably build less bugs in your software.

    Friday, November 3, 2017 12:47 PM
  • User130 posted

    @MichaelRumpler thanks for filing them! I'd much rather be fielding bugs in this preview than once we remove that label and declare it stable!

    Friday, November 3, 2017 9:34 PM
  • User98357 posted

    What ever happened to that commit with the menus that you references before? Was it abandoned?

    Thursday, November 9, 2017 7:56 AM
  • User313806 posted

    another problem: crash when using the message center. with IOS or android, no problem. on MacOS: the message is sent & received. The action is performed. But when back just after the message sending (MessagingCenter.Send...) => crash ! I don't know if this problem has already been pointed, but it should be.

    Pit

    Monday, November 13, 2017 8:06 PM
  • User313806 posted

    HI all I have a problem with forms for MacOS and the "Messaging Center" ! I define some message in a page in order to be able to call some functions of this page from other page. Example: MessagingCenter.Subscribe<SettingsPage>(this, "Nouveau", (sender) => { Nouveau(); });

    this works absolutely fine in my IOS & Android versions. But not with the MacOS version. - the message is sent : OK - the function linked to the message si well executed: OK - BUT just after (when the program must "go back" to the initial page): CRASH at "NSApplication.Main(args);" in the main class Here is the error message: "System.Reflection.TargetInvocationException Exception has been thrown by the target of an invocation."

    iOS there something more to do on MAcOS in order to use the "messaging Center" ? Or is it a problem in the "preview version" ?

    other thing: any idea when the "ScrollTo" for ListView will be implemented ?

    Cheers

    Pierre

    Saturday, November 18, 2017 10:18 AM
  • User313806 posted

    @DavidOrtinau David, is this forum still the place to post the problems with MacOS release ? Or is there another place to post our problems ?

    Cheers

    Pierre

    Tuesday, November 21, 2017 9:53 PM
  • User17304 posted

    Hi guys, Somebody knows which is the latest version that work for mac? I updated to the last Xamarin Forms version and with a simple Hello World sample, the app is broken, I change the version for the first one that supports it and the sample sample works fine. Any idea?

    Wednesday, November 22, 2017 4:19 PM
  • User145262 posted

    Hi guys.. I'm trying to play with tutorial "Preview: Bringing macOS to Xamarin.Forms"

    I'm using the latest stable Xamarin.Forms 2.5, when I'm trying to run Mac app created by following all the steps in tutorial, it crashes with NullReferenceException, stacktrace shows the following error:

    System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.UpdateMainMenu () [0x00021] in <3be6574b266448adae13c61e3dfd820f>:0 at Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00047] in <3be6574b266448adae13c61e3dfd820f>:0 at NightNotes.Mac.AppDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00013] in /Users/bykov/BykovSoft/Projects/NightNotes/NightNotes/NightNotes.Mac/AppDelegate.cs:30 at at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[]) at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /Users/builder/data/lanes/5143/124197ee/source/xamarin-macios/src/AppKit/NSApplication.cs:100

    Could you advice how to fix?

    Thanks!

    Wednesday, November 29, 2017 3:02 PM
  • User223976 posted

    @AlexandrBykov I got the same error. ~~I got rid of it by right clicking the Solution, going to Build -> Configurations -> ConfigurationMappings and change the Configuration for the Mac to either Debug or Release (it was Debug/Release|iPhoneSimulator in my case before). Now the app builds for me but closes immediately after the start. So I'm not really sure if it helps you out or not but I thought I would at least share my findings so far.~~

    EDIT Sorry I just saw that the error still shows up in the output window. I totally missed that.

    EDIT #2 The bug is already known for over a month. Only mentioned workaround is downgrading to 2.4.x: https://bugzilla.xamarin.com/show_bug.cgi?id=60370

    Monday, December 4, 2017 1:01 PM
  • User223976 posted

    @AlexandrBykov said: Hi guys.. I'm trying to play with tutorial "Preview: Bringing macOS to Xamarin.Forms"

    I'm using the latest stable Xamarin.Forms 2.5, when I'm trying to run Mac app created by following all the steps in tutorial, it crashes with NullReferenceException, stacktrace shows the following error:

    System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.UpdateMainMenu () [0x00021] in <3be6574b266448adae13c61e3dfd820f>:0 at Xamarin.Forms.Platform.MacOS.FormsApplicationDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00047] in <3be6574b266448adae13c61e3dfd820f>:0 at NightNotes.Mac.AppDelegate.DidFinishLaunching (Foundation.NSNotification notification) [0x00013] in /Users/bykov/BykovSoft/Projects/NightNotes/NightNotes/NightNotes.Mac/AppDelegate.cs:30 at at (wrapper managed-to-native) AppKit.NSApplication:NSApplicationMain (int,string[]) at AppKit.NSApplication.Main (System.String[] args) [0x00041] in /Users/builder/data/lanes/5143/124197ee/source/xamarin-macios/src/AppKit/NSApplication.cs:100

    Could you advice how to fix?

    Thanks!

    FYI the bug is supposed to be fixed as stated in the bugzilla report (https://bugzilla.xamarin.com/show_bug.cgi?id=60370) in the 2.5.1 nightly version (not sure if/how we could try that ourself).

    Tuesday, December 5, 2017 9:26 PM
  • User130 posted

    @ThomasGoerlich this is the guide on accessing "nightly" builds. https://github.com/xamarin/Xamarin.Forms/wiki/Nightly-Builds

    Wednesday, December 6, 2017 1:37 AM
  • User223976 posted

    @DavidOrtinau said: @ThomasGoerlich this is the guide on accessing "nightly" builds. https://github.com/xamarin/Xamarin.Forms/wiki/Nightly-Builds

    Thanks David. I tried that yesterday after finding your blog post (https://blog.xamarin.com/try-the-latest-in-xamarin-forms-with-nightly-builds/). The problem for me was that i didn't see the nightly versions in Visual Studio for Mac. I just tried it on my work PC and it worked. I'll try it again with my mac when i'm home.

    Wednesday, December 6, 2017 8:48 AM
  • User212442 posted

    @AlexandrBykov @ThomasGoerlich NSApplication.SharedApplication.MainMenu = new NSMenu(); on AppDelegate constructor fix the issue on 2.5.0.121934

    Tuesday, December 12, 2017 3:20 PM
  • User223976 posted

    @YFerrando Oh that is great, thanks for mentioning this workaround.

    Tuesday, December 12, 2017 9:34 PM
  • User263383 posted

    Is this still preview?

    Wednesday, December 27, 2017 7:42 AM
  • User16411 posted

    I added a MacOS project to a Xamarin Forms solution as described here and I'm getting the same error that @"JamesGreen.8031" was getting above:

    Error MM0023: Application name 'MyAppName.exe' conflicts with another user assembly. (MM0023)
    

    This is using Xamarin Forms 2.5.0.1.22203.

    Anyone have any solutions/suggestions for resolving this error?

    Sunday, January 28, 2018 2:25 AM
  • User57869 posted

    @PhilSeeman said: I added a MacOS project to a Xamarin Forms solution as described here and I'm getting the same error that @"JamesGreen.8031" was getting above:

    Error MM0023: Application name 'MyAppName.exe' conflicts with another user assembly. (MM0023)
    

    I got the same problem. It seems like you cannot name your executable the same as another dll.

    Usually you have a PCL (or .NET Standard now) called MyAppName and your MacOS project is called something like MyAppName.MacOS. The PCL will be compiled to MyAppName.dll and the MacOS project to MyAppName.exe. This is not allowed on the Mac. The thing is too stupid to distinguish between the MyAppName.dll and MyAppName.exe.

    You have to rename your projects and/or executable names in the project options. This also means that you have to change the names in your InternalsVisibleToAttribute if you use that.

    Monday, January 29, 2018 4:14 PM
  • User16411 posted

    Thanks @MichaelRumpler , you were right - I renamed my Assembly name under Options > Build > Output and that did the trick. That blog post really should have mentioned this necessary step.

    Tuesday, February 6, 2018 9:40 PM
  • User130 posted

    @"Felix.x" said: Is this still preview?

    It is. See the status on our wiki.

    Wednesday, February 14, 2018 9:23 PM
  • User130 posted

    @PhilSeeman said: Thanks @MichaelRumpler , you were right - I renamed my Assembly name under Options > Build > Output and that did the trick. That blog post really should have mentioned this necessary step.

    I'll review it and add a note. I've done several projects and not run into that issue.

    Wednesday, February 14, 2018 9:24 PM
  • User367841 posted

    @DavidOrtinau said:

    @"Felix.x" said: Is this still preview?

    It is. See the status on our wiki

    I'm glad to see this is still being developed. This blog post announcing it was over a year ago, so I was worried it was no longer under development, but if Forms support is coming for MacOS, this might be the push towards using Xamarin over going with a hybrid app framework.

    Tuesday, April 24, 2018 11:08 PM
  • User330867 posted

    I have followed the instructions to add macOS project to my existing XF Shared code solution and although it compiles successfully, it runs and shows a blank page.

    Any advice?

    Sunday, May 13, 2018 9:02 PM
  • User324325 posted

    I'm trying to use the Webview and the events Navigating and Navigated don´t trigger. I'm using Xamarin.Forms 3.0.0.482510

    ¿Is there any workaround?

    Thursday, May 24, 2018 6:10 PM
  • User324325 posted

    I've updated to the last versión v3.1 (Nightly) and the Webview events are firing now :smile:

    I've another issue with Listview, context menu doesn't open, I use it to delete items, it works on the other platforms. (UWP, Android, iOS and WPF)

    What could I do, any advice? Thanks.

    Tuesday, May 29, 2018 8:27 AM
  • User22675 posted

    Any idea when this will be out of preview? I'm literally dying to be able to do cross-platform Win/MacOS apps with Xamarin Forms (without all the mucking around)

    Tuesday, May 29, 2018 7:41 PM
  • User139040 posted

    @"Mr.X" You can use it right now. We actually have it running in production (disclaimer: with some modifications to forms).

    Monday, June 4, 2018 7:19 PM
  • User22675 posted

    @"BradChase.2654" said: @"Mr.X" You can use it right now. We actually have it running in production (disclaimer: with some modifications to forms).

    Thank you for your reply. Is the procedure still the same or can you now create a forms app without going into XCode at all?

    Monday, June 4, 2018 7:37 PM
  • User139040 posted

    @"Mr.X" The only time I go into XCode now is to provision. Not sure if that is still needed but its all I know. As far as building a macOS app, yes you will need VS installed on the mac. You cant do it remotely :(.

    Monday, June 4, 2018 8:11 PM
  • User22675 posted

    @"BradChase.2654" said: @"Mr.X" The only time I go into XCode now is to provision. Not sure if that is still needed but its all I know. As far as building a macOS app, yes you will need VS installed on the mac. You cant do it remotely :(.

    Thank you for your reply. Is there a walk-through or instructions on how to create a MacOS Xamarin.Forms app using VS for Mac? All the walk throughs I have seen are very old, and are using preview versions of Xamarin.Forms, require GITHUB and XCODE and/or a project made for another platform (e.g. iOS) and then edited... Last time I checked there were lots of hoops to jump through to make it work...

    Monday, June 4, 2018 9:32 PM
  • User139040 posted

    @"Mr.X" The only official one I know of at the moment is:

    https://blog.xamarin.com/preview-bringing-macos-to-xamarin-forms/

    I am sure you have already went over that one though.

    Telerik has a newer one: https://www.telerik.com/blogs/light-up-mac-apps-with-xamarin-forms

    Just be happy it only has to be done once :).

    Monday, June 4, 2018 9:40 PM
  • User262480 posted

    FYI for anyone having trouble with a second window being opened.

    The blog post instructs us to remove the NSMainStoryboardFile key/value pair from Info.plist in order to avoid a second window being created on app start, but the NSMainStoryboardFile key does not exist in the Info.plist generated by the Cocoa app template. I instead had to delete the MainWindow.xib, MainWindow.cs, MainWindowController.cs, and MainWindow.designer.cs files that are automatically generated by the Cocoa app template to fix the second window being opened.

    Wednesday, June 6, 2018 2:37 PM
  • User8556 posted

    @ChaseLong -- Pretty sure NSMainStoryboardFile has just changed to Main storyboard file base name. I blasted that one, and I was up and running.

    A little kludgey how it handles NavigationPages & their "back" buttons, but overall, pretty neat!

    Friday, July 6, 2018 2:02 AM
  • User244259 posted

    Not sure if the menu problem or default window controller issue is resolved. Here is what I tried out (with latest stable forms 3.1.0.*) and it works.

    1. Do not remove the story board from Info.plist. This helps default menu to be visible and you don't need "NSApplication.SharedApplication.MainMenu = new NSMenu();" in AppDelegate

    2. Open the storyboard (in XCode), Click the WindowController, and uncheck the "Is Initial Controller" option from Attribute Inspector

    voila :)

    oops: This is already documented now. https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/mac

    Wednesday, August 22, 2018 8:08 AM
  • User382585 posted

    Hello,

    The last post was from August 2018 ! What is the status of this project ?

    And there is any plans to add Windows and Linux to have a fully true desktop multiplatform ?

    Friday, February 15, 2019 11:14 AM
  • User302063 posted

    Xamarin.forms for Mac OS- I followed the steps. App runs fine however when adding a Xamarin forms effect it won’t compile - what’s up with platformeffects not being available for Xamarin.forms Mac apps - preview has been available for over 14 months and such an important feature is missing. How serious are MS about Xamarin forms apps on MAC. I’d rather they ditch it completely that frustrate developers with half baked previews that never get finished.

    Monday, March 25, 2019 10:34 AM
  • User21505 posted

    I can't find any documentation say if they have moved this from preview to release.. Any news on it?

    Monday, December 30, 2019 1:50 AM
  • User57869 posted

    @DanBol said: I can't find any documentation say if they have moved this from preview to release.. Any news on it?

    The current status is in the docs: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/other/mac

    That page was not changed since 2017. It is still preview.

    I never worked for MS or had any insider information, but I follow everything regarding Xamarin (Forms) since 2014. My personal impression is that Miguel de Icaza is a big Apple fanboy. At one weekend he got bored and coded a proof of concept that Xamarin.Forms could run on the Mac. He tweeted about it, it got viral and then the XF team had to do something. Although they were understaffed and fully occupied with fixing bugs and other stuff Rui Marinho took over the task to make a preview version. I hope you can imagine what huge difference is between a proof of concept and a preview. It took Rui half a year in which he was deeply missed from doing other XF things. There was a big announcement that XF was available on the Mac and that was it. Any more effort would have been too much. So it is still in preview. IMHO the XF team is still understaffed, so they play the OSS card and try to get the community to do PRs. But the code still has to be maintained by Microsoft, so I'm not sure if this is the right solution. However, you are welcome to implement something (for the Mac and other stuff), create PRs to merge it to Xamarin.Forms and be listed as contributor.

    Friday, January 3, 2020 11:00 AM
  • User21505 posted

    @MichaelRumpler Thank you for the reply.

    Friday, January 3, 2020 8:19 PM
  • User61838 posted

    !Good news!

    https://github.com/dotnet/maui/wiki/Roadmap

    NET MAUI Preview 3 (Early 2021) --> macOS Parity committed

    Saturday, May 23, 2020 8:58 AM
  • User37558 posted

    Hi @DavidOrtinau . I tried to follow the official documentation for creating a Mac sample and it didn't work. So I googled around and came to this article which pointed me to this forum post.

    I can't find a working sample anywhere. Is Xamarin.Forms in a working state on macOS at the moment? I've logged my issues here: https://forums.xamarin.com/discussion/184008/working-xamarin-forms-mac-sample#latest

    Saturday, August 1, 2020 10:07 PM