Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[META] Xcode 16.0 Support for .NET 8/9 and MAUI #20802

Open
dalexsoto opened this issue Jul 2, 2024 · 63 comments
Open

[META] Xcode 16.0 Support for .NET 8/9 and MAUI #20802

dalexsoto opened this issue Jul 2, 2024 · 63 comments
Labels
iOS Issues affecting Xamarin.iOS macOS Issues affecting Xamarin.Mac
Milestone

Comments

@dalexsoto
Copy link
Member

dalexsoto commented Jul 2, 2024

The current plan is to release Xcode 16 support with .NET 9 in November.

The current stable version of our workload is not compatible with Xcode 16. We recommend against upgrading until .NET 9 is released.

Warning

Xcode 15.4 does not support macOS 15 (Sequoia). This also means that we don't recommend upgrading your macOS development machines until .NET 9.


You can follow our progress here:

https://github.com/xamarin/xamarin-macios/wiki/xcode16.0-Bindings-Status

@dalexsoto dalexsoto added macOS Issues affecting Xamarin.Mac iOS Issues affecting Xamarin.iOS labels Jul 2, 2024
@dalexsoto dalexsoto added this to the xcode16 milestone Jul 2, 2024
@suchithm
Copy link

Any timeline estimated for Xcode 16.0 Support release ?
@dalexsoto @drasticactions

@rolfbjarne
Copy link
Member

The current plan (which may change at any point) is to do what we did last year: release Xcode 16.0 support with the new .NET version (so with .NET 9 this year).

@kerams
Copy link

kerams commented Aug 2, 2024

Does that mean November at the earliest? I made the unfortunate decision to install Sequoia beta and it does not support Xcode 15. So the question is whether I should consider reverting if Xcode 16 support is still a good 3 months away.

@rolfbjarne
Copy link
Member

Does that mean November at the earliest?

Correct.

@appnwessel
Copy link

  1. Will Microsoft not release a .NET 8 iOS 18 package?
  2. Must we upgrade to .NET 9?
  3. Is there no way to target and consume iOS 18 APIs before November, which is ~2 months after iOS 18 goes live in September?

@rolfbjarne
Copy link
Member

  1. Will Microsoft not release a .NET 8 iOS 18 package?
  2. Must we upgrade to .NET 9?

That's the current plan.

  1. Is there no way to target and consume iOS 18 APIs before November, which is ~2 months after iOS 18 goes live in September?

We're working on releasing previews before November.

@MoienTajik
Copy link

MoienTajik commented Sep 12, 2024

Now that we have reached .NET 9 RC1 along with stable iOS 18, will there be a preview release for this soon?

I currently get this error when try to run my .NET 9 RC1 project in Debug mode on iOS 17 & 18 physical devices on macOS Sequoia with Xcode 16:

Error running 'MyApplication1'
Failed to install application on device Moien’s iPhone: error HE0004: Could not load the framework 'IDEDistribution' (path: /Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/IDEDistribution):
dlopen(/Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/IDEDistribution, 0x0001): Library not loaded: @rpath/AppThinning.framework/Versions/A/AppThinning
Referenced from: <33FF2F3B-A96F-37B4-BA4E-88D882BF9D> /Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/IDEDistribution
Reason: tried: '/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_17.5/17.5.9270-net9-rc1/tools/lib/mlaunch/mlaunch.app/Contents/Frameworks/AppThinning.framework/Versions/A/AppThinning' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/AppThinning.framework/Versions/A/AppThinning' (no such file), '/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_17.5/17.5.9270-net9-rc1/tools/lib/mlaunch/mlaunch.app/Contents/MonoBundle/AppThinning.framework/Versions/A/AppThinning' (no such file)

@vhugogarcia
Copy link

vhugogarcia commented Sep 17, 2024

Well, I think I updated without notification from macOS. Somehow I had automatic updates enabled, and I did not see this post before applying the update.

I believe I need to rollback the macOS and XCode as well somehow 😢.

Update
In case you are on the same situation, I think I can only downgrade my Mac using macOS Recovery or a bootable USB.

@BrandanN21
Copy link

@vhugogarcia You can downgrade your xcode version by installing it via the developer portal https://developer.apple.com/download/all/ and finding xcode 15.4 (or any other previous version you want installed). You can have multiple xcode installs at the same time.

I have xcode 16 and 15.4 installed. You will just need to ensure that your pointing to the correct command line tools (15.4) in order to get the app building correctly.

As for the MacOS downgrade I'm not sure the best way to do that. Hope that this helps a little bit!

@bpmccarty
Copy link

bpmccarty commented Sep 17, 2024

I have a workaround for the people who have upgraded to MacOS Sequoia. If you download the very first XCode 16 beta which was released on June 10th, it will work with MAUI and .NET 8 (and .NET 9 Preview). I have been using this setup for the past couple of months. Here is the link to download:

https://download.developer.apple.com/Developer_Tools/Xcode_16_beta/Xcode_16_beta.xip

@vhugogarcia
Copy link

vhugogarcia commented Sep 17, 2024

@vhugogarcia You can downgrade your xcode version by installing it via the developer portal https://developer.apple.com/download/all/ and finding xcode 15.4 (or any other previous version you want installed). You can have multiple xcode installs at the same time.

I have xcode 16 and 15.4 installed. You will just need to ensure that your pointing to the correct command line tools (15.4) in order to get the app building correctly.

As for the MacOS downgrade I'm not sure the best way to do that. Hope that this helps a little bit!

Thanks @BrandanN21 for pointing it out. I was able to download the version 15.4 from the developer portal, and I'm able to run XCode in macOS Sequoia using the command line as shown below:
image

I also checked XCode and I can confirm the command line version is selected correctly:
image

However, on VS Code, when I try to run the app on the selected simulator I get the following error message:
image
and if I click no Debug anyway, I get the next error:
image

However, when I run dotnet workload list I get
image

The launch.json only has this content:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": ".NET MAUI",
            "type": "maui",
            "request": "launch",
            "preLaunchTask": "maui: Build"
        }
    ]
}

Update: I noticed, I replaced XCode 16 with the one I downloaded. Let me install the version XCode 16 from app store and leave the other installed somehow.

Update #2: I installd both versions of XCode and updated the commandlines and confirmed that we are using the right version of XCode by using xcode-select command in terminal, and the issue still persists.

I'm not sure where exactly to look now hehehe! any hint or recommendation?

@vhugogarcia
Copy link

@rolfbjarne I noticed that you merged this PR which I believe brings support for XCode 16 and macOS Sequoia. #21193

Do you think is there a way you can release maybe a preview of the macios SDK, so we can install it and test it as well? please 🙏🏻

@dhewitson
Copy link

dhewitson commented Sep 18, 2024

I have a workaround for the people who have upgraded to MacOS Sequoia. If you download the very first XCode 16 beta which was released on June 10th, it will work with MAUI and .NET 8 (and .NET 9 Preview). I have been using this setup for the past couple of months. Here is the link to download:

https://download.developer.apple.com/Developer_Tools/Xcode_16_beta/Xcode_16_beta.xip

@bpmccarty You're a life saver!

@skullboypl
Copy link

skullboypl commented Sep 18, 2024

I have a workaround for the people who have upgraded to MacOS Sequoia. If you download the very first XCode 16 beta which was released on June 10th, it will work with MAUI and .NET 8 (and .NET 9 Preview). I have been using this setup for the past couple of months. Here is the link to download:

https://download.developer.apple.com/Developer_Tools/Xcode_16_beta/Xcode_16_beta.xip

for me i can see simulators on Windows Visual Studio but its not starting simulator like in a loop "Checking connection to simulator" "Conneting to pc Mac" "Conneted" and loop

@steven-pearson
Copy link

Not a great position. Can’t believe you’re recommending not upgrading to macOS 15! MS has known that it would be in this position for best part of 3 months - quite poor.

Hopefully some way of SxS loading Xcode 15.4 will work.

@vhugogarcia
Copy link

I have a workaround for the people who have upgraded to MacOS Sequoia. If you download the very first XCode 16 beta which was released on June 10th, it will work with MAUI and .NET 8 (and .NET 9 Preview). I have been using this setup for the past couple of months. Here is the link to download:

https://download.developer.apple.com/Developer_Tools/Xcode_16_beta/Xcode_16_beta.xip

I have tried this solution without luck. I have installed Xcode 16 and XCode 16 Beta 1, should I uninstall the final version and just leave the Beta 1?

I keep getting the same error as before:
image
image

@redradist
Copy link

Not a great position. Can’t believe you’re recommending not upgrading to macOS 15! MS has known that it would be in this position for best part of 3 months - quite poor.

Hopefully some way of SxS loading Xcode 15.4 will work.

As for me it also strange, because demo Flutter app work out the box on new MacOS Sequoia

@cbogner85
Copy link

Same here, accidentally updated to Sequoia and now I'm lost... luckily my Macbook isn't updated yet, so at least I can debug iOS there. Hope to see a solution shortly.

@lszl84
Copy link

lszl84 commented Sep 18, 2024

Not a great position. Can’t believe you’re recommending not upgrading to macOS 15! MS has known that it would be in this position for best part of 3 months - quite poor.

Hopefully some way of SxS loading Xcode 15.4 will work.

Exactly. They've had months to prepare, and this feels highly disrespectful to MAUI developers. It's surprising and disappointing to see this level of unprofessionalism from any company, let alone Microsoft.

@christophedelanghe
Copy link

@rolfbjarne : This is unbelievable. Sequoia has been released, and XCode16 is out, but support for Maui isn't planned until November? Where are the good old days when Xamarin took pride in providing support for new versions the very next day?
Where is this headed? Does Microsoft have so little respect for MAUI developers?

@jaysidri
Copy link

jaysidri commented Sep 18, 2024

Everybody calm down and take a breath -- the solution is pretty simple if you've upgraded early (it's there if you read the comment thread). Apple isn't going to mandate apps built with Xcode16 until next year.

Link to comment with solution: #20802 (comment)

@brian1006bt
Copy link

I have macOS Sequoia auto-upgraded and also Xcode to the latest 16. Now, the Xamarin studio does not show an iOS simulator to run & debug the app. It says "Lower the Deployment Target to see older simulators.."
Also, while running the app on the real device (iPhone-iOS-18) at Release mode - it gives an error Could not load the framework 'IDEDistribution' (path: /Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/IDEDistribution): dlopen(/Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/IDEDistribution, 0x0001): Library not loaded: @rpath/AppThinning.framework/Versions/A/AppThinning Referenced from: <33FF2F3B-A96F-37B4-BA4E-887BD882BF9D> /Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/IDEDistribution Reason: tried: '/Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.23/lib/mlaunch/mlaunch.app/Contents/Frameworks/AppThinning.framework/Versions/A/AppThinning' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/Frameworks/AppThinning.framework/Versions/A/AppThinning' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.23/lib/mlaunch/mlaunch.app/Contents/Frameworks/AppThinning.framework/Versions/A/AppThinning' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/IDEDistribution.framework/Versions/A/Frameworks/AppThinning.framework/Versions/A/AppThinning' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/16.4.0.23/lib/mlaunch/mlaunch.app/Contents/MonoBundle/AppThinning.framework/Versions/A/AppThinning' (no such file)
Additionally, I downgraded the Xcode to 15.4 but now it is not allowing to run Xcode on the latest MacOS Sequoia. It says - Sequoia needs Xcode 16 to run.
I am badly stuck now.

@jayendra02 For me, downloading xcode beta did work. I am running the latest Sequio Mac release, with the full xcode 16 in parallel. Here are the steps to get and use the older beta version to get through this for now:

  • Log into your Apple Developer Account
  • go here https://developer.apple.com/download/all/
  • search for xcode beta 1, June 10th 2024 and download that
  • extract the xip file
  • move the Xcode beta app to a temp/dev folder (so you can delete it easily down the road)
  • once you run xcode beta, make sure you are also download the beta simulator (it will not work with the full ios18 simulator)
  • change your Xcode path in your Editor to point to this new location of xcode beta (by default it will point to your full xcode 16 if you did the upgrade)

that should be it.

It worked for me, I installed the beta 1 and that simulator ( I installed the simulator with simctl runtime add "~/Downloads/<simulator-runtime-name>.dmg") and now I'm not getting any issue

@MoienTajik
Copy link

Using Xcode beta makes the simulator work, and it's better than nothing, obviously. However, the simulator is not the optimal solution for more complicated apps, such as those with payment features, because Apple Pay doesn't work on the simulator and it simply means you would be almost stopped from development (or have to erase everything and rollback to the previous Mac version, which is ...)

It was expected that this would happen with the current roadmap ...

.NET+Mac/Xcode releases don't necessarily need to be aligned as such cases can happen ... I hope there's a better plan next time, with things ready from the early preview versions.

@rezamohamed
Copy link

@MoienTajik, using Xcode beta, I can still test on a physical device, not just a simulator. So, for all intents and purposes, this workaround feels like business as usual for now.

@MoienTajik
Copy link

MoienTajik commented Sep 18, 2024

@MoienTajik, using Xcode beta, I can still test on a physical device, not just a simulator. So, for all intents and purposes, this workaround feels like business as usual for now.

@rezamohamed I still get this on physical device on Debug/Release mode:
#20802 (comment)

@rezamohamed
Copy link

@MoienTajik, using Xcode beta, I can still test on a physical device, not just a simulator. So, for all intents and purposes, this workaround feels like business as usual for now.

@rezamohamed I still get this on physical device on Debug/Release mode: #20802 (comment)

The only difference there seems to be that you are running .NET 9 RC1 whereas I am running .NET 8 8.0.90.

@Bnjbel97
Copy link

Bnjbel97 commented Sep 18, 2024

If this helps someone. It appeared my mac auto updated Monday, even though that setting is turned off. Not certain how this happened. None the less, I upgraded all devices and xcode after the mac update to receive the above issue. I found this thread and the post by @bpmccarty. I appreciate you by the way. Below are my steps to debug on the device. I have not tried a release as of yet nor tested but it does compile and debug.

Downloaded xcode beta June 10th release
Removed xcode 16
unpacked xcode beta
moved xcode beta to the applications directory and renamed from xcode-beta to xcode.
started xcode, let it run the usual component install.
sync'ed via visual studio worked fine.
compile and it worked.

** Just to clarify as well. Runtime 8.0.90 / physical device running ios 18

@jayendra02
Copy link

Thanks a ton rezamohamed.
This worked.

For me, downloading xcode beta did work. I am running the latest Sequio Mac release, with the full xcode 16 in parallel. Here are the steps to get and use the older beta version to get through this for now:

  • Log into your Apple Developer Account
  • go here https://developer.apple.com/download/all/
  • search for xcode beta 1, June 10th 2024 and download that
  • extract the xip file
  • move the Xcode beta app to a temp/dev folder (so you can delete it easily down the road)
  • once you run xcode beta, make sure you are also download the beta simulator (it will not work with the full ios18 simulator)
  • change your Xcode path in your Editor to point to this new location of xcode beta (by default it will point to your full xcode 16 if you did the upgrade)

that should be it.

@pooranoayaw
Copy link

I do not see this feature tracked here .. https://developer.apple.com/documentation/sms_and_call_reporting

@fernlance
Copy link

@skullboypl

for me i can see simulators on Windows Visual Studio but its not starting simulator like in a loop "Checking connection to simulator" "Conneting to pc Mac" "Conneted" and loop

This worked for me albeit on Parallels (win11, vs2022)

  • Ensure that Xamarin Mac Agent (XMA) and Xcode aren't running.
  • Delete your ~/Library/Developer/CoreSimulator/Devices folder.
  • Run killall -9 com.apple.CoreSimulator.CoreSimulatorService.
  • Run xcrun simctl list devices.

source: learn.microsoft.com

@entdark
Copy link

entdark commented Sep 19, 2024

I personally updated to iOS 18 and macOS 15 but did not update Xcode, and it deploys and gets debugged fine with .NET 8.
For those who automatically updated to Xcode 16 can try to get a previous version and it should just work.

@asoliman1984
Copy link

I personally updated to iOS 18 and macOS 15 but did not update Xcode, and it deploys and gets debugged fine with .NET 8. For those who automatically updated to Xcode 16 can try to get a previous version and it should just work.

unfortunately you can't install Xcode 15.4 on macOS 15

@AlleSchonWeg
Copy link

Hi,
it is possible to test a old xamarin app with iOS 18 simulator?

@lobbo232
Copy link

Hi, it is possible to test a old xamarin app with iOS 18 simulator?

No. I have this issue too. If you install XCode 16, you can't run any simulators at all via Visual Studio, and you can't run iOS 18 simulator on XCode 15 so there is no way to do this.

You will need an actual iOS 18 device to test on.

@asoliman1984
Copy link

Hi, it is possible to test a old xamarin app with iOS 18 simulator?

I'm waiting for the answer for that question, i have app running on xamarin, [.Net Standard 2.1]
image

@entdark
Copy link

entdark commented Sep 19, 2024

unfortunately you can't install Xcode 15.4 on macOS 15

Why so? It's pretty much available on https://developer.apple.com/download/applications/

@churchs19
Copy link

These are the steps I used to get working in VS Code on Mac OS Sequoia 15.0 again. You can run MAUI apps against the new iOS 18 simulators after this as well:
microsoft/vscode-dotnettools#1449 (comment)

@vhugogarcia
Copy link

vhugogarcia commented Sep 19, 2024

Thanks @BrandanN21, @rezamohamed, @rolfbjarne and all who helped me to solve my issue. I can confirm the issue has been fixed and I can continue debugging/developing mobile apps in .NET MAUI using:

  • Visual Studio Code + .NET MAUI extension
  • macOS Sequioa
  • XCode 16 + XCode 15.4 (installed both side by side)

I also went ahead and created a blog post article where I share my experience, I hope it helps others as well. https://dev.to/vhugogarcia/solving-net-maui-issues-on-macos-sequoia-with-visual-studio-code-and-xcode-16-3ljd

@rezamohamed
Copy link

unfortunately you can't install Xcode 15.4 on macOS 15

Why so? It's pretty much available on https://developer.apple.com/download/applications/

@entdark Xcode 15 doesn't work on Sequioa, it requires you to update to Xcode 16

@churchs19
Copy link

churchs19 commented Sep 19, 2024

unfortunately you can't install Xcode 15.4 on macOS 15

Why so? It's pretty much available on https://developer.apple.com/download/applications/

@entdark Xcode 15 doesn't work on Sequioa, it requires you to update to Xcode 16

@rezamohamed It does work, you just can't launch it by clicking on the icon in Launchpad. You have to launch it from the command line.

@asoliman1984
Copy link

unfortunately you can't install Xcode 15.4 on macOS 15

Why so? It's pretty much available on https://developer.apple.com/download/applications/

@entdark Xcode 15 doesn't work on Sequioa, it requires you to update to Xcode 16

@rezamohamed It does work, you just can't launch it by clicking on the icon in Launchpad. You have to launch it from the command line.

How did you run Version 15.4 from command line ?
image

@rezamohamed
Copy link

@asoliman1984 Go here: Xcode 15 version App —> Right click —> Show package contents —> Contents —> MacOS —> Xcode (Double click), That will open Xcode 15

@asoliman1984
Copy link

@asoliman1984 Go here: Xcode 15 version App —> Right click —> Show package contents —> Contents —> MacOS —> Xcode (Double click), That will open Xcode 15

Thanks @rezamohamed that works for me

@jayendra02
Copy link

rezamohamed
After your suggestion - the Xcode beta, I tried rolling out a build for TestFlight but it gave an "Asset Validation Error".

Screenshot 2024-09-19 at 11 16 48 PM

@rezamohamed
Copy link

Haven’t reached the App Store deployment part yet. So that might be a different ball of wax.

Can you try removing Xcode 16 and 16beta (it’s not merely just deleting the app from Applications but manually deleting a bunch of folders to restore it to a clean state with no Xcode - I asked ChatGPT for the steps). And then downloading Xcode 15.4 and running it via command line - I posted some steps above.

Report back here if you were able to deploy to TestFlight/App store please.

@bitzeal-johan
Copy link

Could somebody from the development team make an official page of how to properly work around this so that people can keep developing .net for ios even though having an up to date OS version? I.e. a guide that works should you use VS, VS Code, Rider, etc.

Thanks

@luisrr1590
Copy link

luisrr1590 commented Sep 19, 2024

@vhugogarcia You can downgrade your xcode version by installing it via the developer portal https://developer.apple.com/download/all/ and finding xcode 15.4 (or any other previous version you want installed). You can have multiple xcode installs at the same time.

I have xcode 16 and 15.4 installed. You will just need to ensure that your pointing to the correct command line tools (15.4) in order to get the app building correctly.

As for the MacOS downgrade I'm not sure the best way to do that. Hope that this helps a little bit!

How do you install 15.4 in Sequoia? I'm getting this error after downloading

Screenshot 2024-09-19 at 12 43 09 p m

To be honest I was expecting it. But since you say you could do it I'd like to know how.

@rezamohamed
Copy link

Instructions are already posted above

@luisrr1590
Copy link

luisrr1590 commented Sep 19, 2024

managed to Open 15.4 and changed the command line tools to 15.4 but I still get the same error in VS code "maui:Build task not found".

What im I missing?

@luisrr1590
Copy link

luisrr1590 commented Sep 19, 2024

Thanks @BrandanN21, @rezamohamed, @rolfbjarne and all who helped me to solve my issue. I can confirm the issue has been fixed and I can continue debugging/developing mobile apps in .NET MAUI using:

  • Visual Studio Code + .NET MAUI extension
  • macOS Sequioa
  • XCode 16 + XCode 15.4 (installed both side by side)

I also went ahead and created a blog post article where I share my experience, I hope it helps others as well. https://dev.to/vhugogarcia/solving-net-maui-issues-on-macos-sequoia-with-visual-studio-code-and-xcode-16-3ljd

Thanks a lot @vhugogarcia I followed your blog post and managed to solve it.

@LeoJHarris
Copy link

@vhugogarcia you should update your blog here:

"Disable App Store automatic update" update to "Install xcodes for managing Xcode versions"

Best thing I ever did when managing xcode versions, installing versions side by side and switching between these a breeze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues affecting Xamarin.iOS macOS Issues affecting Xamarin.Mac
Projects
None yet
Development

No branches or pull requests