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

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

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

Comments

@dalexsoto
Copy link
Member

dalexsoto commented Jul 2, 2024

⚠️ Xcode 16 support is now released for .NET 8, please see release notes https://github.com/xamarin/xamarin-macios/releases/tag/dotnet-8.0.1xx-xcode16.0-8303 for installation instructions. This version of the macios workloads will be also included in the next version of Visual Studio 17.11.5.


The current plan is to release Xcode 16 support with .NET 8 soon and with .NET 9 in November (.NET 9 RC 2 will also contain Xcode 16 support).

The current stable version of our workload is not compatible with Xcode 16. We recommend against upgrading until we've released support for Xcode 16.

Warning

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


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)

@last-Programmer
Copy link

last-Programmer commented Sep 27, 2024

@dalexsoto thanks for the update. any idea about when .net 9 rc2 will be released? since .net 9 is already go live we have migrated our projects to .net9 rc. so waiting for this fix in .net 9 rc2.

@dalexsoto
Copy link
Member Author

Hey @dalexsoto and @rolfbjarne,

I just wanted to give a huge shoutout to both of you, and the team behind, for your amazing work on getting Xcode 16 and macOS Sequoia support up and running. You guys rock! 🎉

Your dedication and hard work have made life so much easier for all of us in the .NET community. Thanks to you, we can keep building awesome apps without missing a beat. Seriously, your efforts are hugely appreciated!

Let's test this new release!

Best, Victor

Thanks! Appreciated 🙏 I will pass along the kudos to the team! We would also not be here without you ALL amazing community!

@dalexsoto
Copy link
Member Author

@dalexsoto thanks for the update. any idea about when .net 9 rc2 will be released? since .net 9 is already go live we have migrated our projects to .net9 rc. so waiting for this fix in .net 9 rc2.

Hello, unfortunately we don’t have a date yet as we all are still working out the details for RC2 but it should be coming soon somewhere in October

@batmanonabike
Copy link

Hey @dalexsoto and @rolfbjarne,

I just wanted to give a huge shoutout to both of you, and the team behind, for your amazing work on getting Xcode 16 and macOS Sequoia support up and running. You guys rock! 🎉

Your dedication and hard work have made life so much easier for all of us in the .NET community. Thanks to you, we can keep building awesome apps without missing a beat. Seriously, your efforts are hugely appreciated!

Let's test this new release!

Best, Victor

Hmmmm

@vedatozkanTr
Copy link

vedatozkanTr commented Sep 27, 2024

  • xcode Version 16.0 (16A242d)

  • simulator 18

  • OS maxOS Sequoia

VsCode Version: 1.93.1

ERROR :
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/17.2.8053/tools/msbuild/iOS/Xamarin.Shared.targets(1805,3): error : The specified iOS provisioning profile '*********' could not be found .

but library/developer/Xcode/userdata/provisioning profiles folder found provision profiles key.

I recreated the iOS certificate and key on the developer side. But I can't fix this error. What should I do to fix the error?

Thank You All

@last-Programmer
Copy link

last-Programmer commented Sep 27, 2024

@vedatozkanTr download the profiles manually to mobiledata/provisioningprofiles directory

@alisariaslan
Copy link

alisariaslan commented Sep 27, 2024

If you still haven't managed to debug or deploy your project with xcode16, you can try these steps: (These steps worked for me)

  • Uninstall dotnet with: "brew uninstall --cask dotnet-sdk" (Install first if says not installed)
  • Remove any remaining files with: "sudo rm -rf /usr/local/share/dotnet"
  • After successful removal, make sure you cannot use any dotnet command.
  • Then download Dotnet SDK 8.0.402 from official page and install it.
  • Make sure "dotnet --version" commands works and shows 8.0.402
  • After installing run this command: "sudo dotnet workload install maui"
    Then hopefully you are able to debug and deploy your project on IOS 18 simulators with VS for Mac 17.6.14+

@vedatozkanTr
Copy link

If you still haven't managed to debug or deploy your project with xcode16, you can try these steps: (These steps worked for me)

  • Uninstall dotnet with: "brew uninstall --cask dotnet-sdk" (Install first if says not installed)
  • Remove any remaining files with: "sudo rm -rf /usr/local/share/dotnet"
  • After successful removal, make sure you cannot use any dotnet command.
  • Then download Dotnet SDK 8.0.402 from official page and install it.
  • Make sure "dotnet --version" commands works and shows 8.0.402
  • After installing run this command: "sudo dotnet workload install maui"
    Then hopefully you are able to debug and deploy your project on IOS 18 simulators with VS for Mac 17.6.14+

I did everything you said.

Workload version: 8.0.400-manifests.2772ffde
Configured to use loose manifests when installing new manifests.
[maui]
Installation Source: SDK 8.0.400
Manifest Version: 8.0.82/8.0.100
Manifest Path: /usr/local/share/dotnet/sdk-manifests/8.0.100/microsoft.net.sdk.maui/8.0.82/WorkloadManifest.json
Install Type: FileBased

dotnet --version
8.0.402

When I try to run the project on the iOS simulator, it gives the following error.

/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net8.0_18.0/18.0.8303/tools/msbuild/iOS/Xamarin.Shared.targets(1835,3): error : The specified iOS provisioning profile '**********' could not be found
TargetFramework=net8.0-ios

then
download the profiles manually to mobiledata/provisioningprofiles directory
working.... Thank You

@vhugogarcia
Copy link

vhugogarcia commented Sep 27, 2024

@vedatozkanTr just for curiosity, where is that folder located (full path) where you moved the provisioning profiles within MacOS?

@albyrock87
Copy link

If you want to stick with XCode 15.x in your CI builds, just:

dotnet workload install maui-mobile --version 8.0.402

@vedatozkanTr
Copy link

@vedatozkanTr just for curiosity, where is that folder located (full path) where you moved the provisioning profiles within MacOS?

~/Library/Developer/Xcode/UserData/Provisioning Profiles
To
~/Library/MobileDevice/Provisioning Profiles

@vhugogarcia
Copy link

@vedatozkanTr just for curiosity, where is that folder located (full path) where you moved the provisioning profiles within MacOS?

~/Library/Developer/Xcode/UserData/Provisioning Profiles To ~/Library/MobileDevice/Provisioning Profiles

Thank you

@zijianhuang
Copy link

If you happened to upgrade to xcode v16 and macos Sequoia 15, this is not the end of the world, before November when the magic may come.
At least in this instance, you don't need to download xCode to v15.4 or alike.

Don't run to such situation again

Before upgrading xCode, make sure checking https://github.com/dotnet/maui/wiki/Release-Versions since Visual Studio could be a few weeks or a few months behind the latest xCode.

Remarks:

  • I have great respects to Xamarin/MAUI teams, since I understand the difficulty of developing cross platforms dev tools, as I have been through qt and Kylix etc.
  • I urge app developers to be patient, especially the .NET and MAUI teams might have suffered from recent massive layoff of staffs.

What you can do before November

You can do local test with AdHoc profile though without debugging, and build with production profile, as long as you can pair with the mac, yes, VS 2022 v17.11.4 can pair with xcode v16 and macos Sequoia 15, even though in VS:

  1. Emulators not appearing
  2. iOS devices connected to Mac not appearing.
  3. You can see only "Remote device, Local device, Simulators (xcode mismatch)

For testing, though without debugging, you can do:

  1. Build with the AdHoc profile locked with your iOS devices. Debug build for saving build time. And the IPA file will be generated on the mac side: (/Users/myUserName/Library/Caches/Xamarin/mtbs/builds/My.App.iOS/5415201399a22f416e1bab831c712aee75c7d2a4c970ced5391e2/bin/Debug/net8.0-ios/ios-arm64/
  2. On Mac, go to "xCode/Window/Devices and Simulator". And in the Devices tab, you see the connected devices, click one of them, Mac may try to pair with it and copy some dev needed files. You may get a warning asking you to put your iOS device to Developer Mode, and do it.
  3. On Mac, locate the IPA file and drag & drop (or Plus) it to "Installed Apps", then Mac will upload the IPA to your device.
  4. Then run the app on your iOS device.

Without debugging, it may not be good for new app development, or legacy apps with dirty codes, which need intensive debugging, often with simulators. Other than this, this workaround is just less ideal than the November magic.

@VladimirPlatun
Copy link

Good afternoon! After updating VIsual Studio for mac to version 17.6.14 and updating xcode to version 16, my Xamarin Forms app stopped seeing ios device simulators. Displays the following message: Lower the 'Deployment Target' to see older simulators or check your Apple SDK path warning after update . What are the possible solutions or how to add an old version of the Apple SDK?

@suchithm
Copy link

suchithm commented Sep 30, 2024

Bit edit, i was facing the unable to deploy to device issue. that was fixed by the above answer

On Mac, locate the IPA file and drag & drop (or Plus) it to "Installed Apps", then Mac will upload the IPA to your device.

After installing by drag and drop once in device, for the subsequence deployment works fine by connecting the debugger.

@VladimirPlatun
Copy link

@suchithm

On Mac, locate the IPA file and drag & drop (or Plus) it to "Installed Apps", then Mac will upload the IPA to your device.

After installing by drag and drop once in device, for the subsequence deployment works fine by connecting the debugger.

The IPA File of my application? And how does this relate to Visual Studio for mac, why does it work this way?

@imadofficial
Copy link

dotnet/maui#23380 Has this issue been addressed yet?

@pininfarino
Copy link

Hello, does anyone here have a really functional guide on how to make a release build for MAUI
with the Sonoma or Sequoia system?

Azure DevOps is also down, Microsoft changed MAUI global.json and all builds in error.

Is it possible to make a release now?
And that local build? For iOS?
Or Azure DevOps in YAML?

Errors everywhere with MAUI ios 18 :(

Does anyone have a tried and tested working guide for an IPA file that can be built and signed?

https://www.youtube.com/watch?v=2zpCOYkdvTQ

@zijianhuang
Copy link

@pininfarino
Have a look at my comment above. And I have actually published a release build to App Store under such conditions.
Not using Azure DevOps, but old school way: Mac beside Windows dev PC. And for local tests on native devices, you need to operate directly inside Mac.

@giuseppenovielli
Copy link

giuseppenovielli commented Oct 2, 2024

Hi,
If i install XCode 16, it works with Xamarin.Forms?
It works debug and release to AppStore works?
It works with last version of Visual Studio for Mac?

@rolfbjarne
Copy link
Member

Hi, If i install XCode 16, it works with Xamarin.Forms? It works debug and release to AppStore works? It works with last version of Visual Studio for Mac?

No, Visual Studio for Mac does not work with Xcode 16 (#21326).

@giuseppenovielli
Copy link

giuseppenovielli commented Oct 2, 2024

Hi I had installed Xcode 16 beta and its install perfectly as I can see simulators in Visual studio. I had Xamarin Forms iOS project that build successfully and i can see "waiting for debugger connect to ios simulator" but nothing happen what should i do?

* xcode 16 beta

* simulator 17.5 and 18

* OS maxOS Sequoia

Xamarin.Forms is out of support

Thanks for update. I had fixed this and now iOS 18 simulator is working fine for my Xamarin Project. but for MAUI project still facing the Same

@Ashishkumar5699 you can build Xamarin.Forms iOS application with iOS 18? It work with Xamarin.Forms?

yes, its a bit slow but fine for me.

Thanks @rolfbjarne,
but @Ashishkumar5699 says yes? I don't understand?

@rolfbjarne
Copy link
Member

but @Ashishkumar5699 says yes? I don't understand?

A Xamarin.Forms app might work on iOS 18, and you might be able to build a Xamarin.Forms app from the command line when using Xcode 16, but afaik Visual Studio for Mac is not able to launch/debug apps when using Xcode 16 / on an iOS 18 device.

@giuseppenovielli
Copy link

@rolfbjarne interesting what is the command?
So i can edit code with Visual Studio for Mac, debug with 'Console' app on my Mac and release AppStore with command line tools?

@VladimirPlatun
Copy link

@rolfbjarne Сan I use Xcode 16 to run the application through debugger and emulators with ios version <18? If so, how, because at the moment, all the emulators are gone

@rolfbjarne
Copy link
Member

@rolfbjarne interesting what is the command? So i can edit code with Visual Studio for Mac, debug with 'Console' app on my Mac and release AppStore with command line tools?

I haven't seen anything indicating that this isn't possible.

Note that since Xamarin.iOS is not supported anymore, it may break (if it even works) at any point, and we won't fix it.

To build from the command line:

msbuild path/to/myproject.cs /p:Platform=iPhone[Simulator]

To install on a device:

VSMac uses an internal command-line tool called mlaunch. The easiest way to figure out how it's used is probably to launch on device (using Xcode 15.4), and then look at the process list by doing something like ps aux | grep mlaunch. Note that you have to sprinkle in quotes as needed, because ps doesn't show those.

And then you can see Console.WriteLines in the Console app.

@rolfbjarne Сan I use Xcode 16 to run the application through debugger and emulators with ios version <18?

AFAIK no.

@Cholponai02
Copy link

Cholponai02 commented Oct 3, 2024

Hello everyone, I have the same problem with launching a project, it won't build.

Yesterday I updated MacOS to Sequoia 15, and the project stopped building on MAUI
Xcode version 16
VS Code 1.92.0 (universal)

I'm new to using MacOS, I read all the above tips, but I'm confused

@trucidare
Copy link

trucidare commented Oct 5, 2024

Copy the AppThinning to the mlaunch app. (Here the rc.1 version)

cd /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_17.5/17.5.9270-net9-rc1/tools/lib/mlaunch/mlaunch.app/Contents/
sudo mkdir Frameworks
sudo cp -r /Applications/Xcode.app/Contents/SharedFrameworks/AppThinning.framework ./Frameworks

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