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 · 70 comments
Open

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

dalexsoto opened this issue Jul 2, 2024 · 70 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)

@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.

@jayendra02
Copy link

jayendra02 commented Sep 20, 2024

rezamohamed

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.

I installed Xcode 15.4 & set the command line path to Xcode 15.4. But while archiving build it gave me an error "Launch images are deprecated in iOS 13.0. Use a launch storyboard or XIB instead."., which was not the case for previous archives.

@bitzeal-johan
Copy link

After switching to xcode 15.4 using xcodes and starting debugging my project in Rider, everything builds but after this message in the console, nothing happens:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_17.5/17.5.9270-net9-rc1/tools/bin/mlaunch --launchsim /Users/johanfranzen/repo/N/NiOS/bin/Debug/net9.0-ios/iossimulator-arm64/NiOS.app --device=:v2:udid=A6A9B613-NNNN-NNNN-88D5-A1D38E6262BD -sdk 17.5 --argument=-monodevelop-port --argument=10000 --setenv=XAMARIN_DEBUG_PORT=10000 --sdkroot /Applications/Xcode-15.4.0.app/Contents/Developer

Anybody had this problem and got past it?

@imadofficial
Copy link

After switching to xcode 15.4 using xcodes and starting debugging my project in Rider, everything builds but after this message in the console, nothing happens:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_17.5/17.5.9270-net9-rc1/tools/bin/mlaunch --launchsim /Users/johanfranzen/repo/N/NiOS/bin/Debug/net9.0-ios/iossimulator-arm64/NiOS.app --device=:v2:udid=A6A9B613-NNNN-NNNN-88D5-A1D38E6262BD -sdk 17.5 --argument=-monodevelop-port --argument=10000 --setenv=XAMARIN_DEBUG_PORT=10000 --sdkroot /Applications/Xcode-15.4.0.app/Contents/Developer

Anybody had this problem and got past it?

I also had this issue on Rider. Although it compiles & everything, it doesn't actually install the app inside the simulator. Only workaround i found was to drag & drop the .app inside of the simulator.

@MoritzLe0809
Copy link

I get the error:

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_17.5/17.5.8030/tools/msbuild/iOS/Xamarin.Shared.targets(473,3): error : Bundle Resource 'Strings/yggumve0.sso~' not found on disk

Visual Studio Mac 2022

Tried with Xcode 15.4 and 16_Beta

Can anyone help? I can't release a new version of my app

@rezamohamed
Copy link

A lot of my issues went away by creating a dev environment that has only one version of Xcode and not the multiple versions in parallel that I’m seeing folks use. It’s also one less variable to worry, to figure out if it’s a version mismatch issue. I did a complete uninstall of Xcode, all the Xcode folders, /library/developer, simulators, etc and only install Xcode 15.4 and 17.5 simulators on Sequoia, physical device with iOS 18 to test. Not saying this is the solution, just my $0.02 for piece of mind.

@CaseAlexander
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

Can anyone confirm this is still an option? When I go to the link I'm directed to "Unathorized. Your account can't access this page"

@rezamohamed
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

Can anyone confirm this is still an option? When I go to the link I'm directed to "Unathorized. Your account can't access this page"

Go here and scroll to the one you want
https://developer.apple.com/download/all/

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