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 14.0 Support #15954

Closed
Tracked by #14029
dalexsoto opened this issue Sep 13, 2022 · 97 comments
Closed
Tracked by #14029

[Meta] Xcode 14.0 Support #15954

dalexsoto opened this issue Sep 13, 2022 · 97 comments
Milestone

Comments

@dalexsoto
Copy link
Member

dalexsoto commented Sep 13, 2022

🚨 Update 2 ⚠️

The Xcode 14.0 support to Xamarin.iOS is now available in the stable releases of Visual Studio for Widows and Mac. Please update to the latest stable versions of both.

Thank you for your patience!

The macios team!


Update 1

🚨 Update ⚠️

Hello All!

We have what we believe is the final build for Xcode 14.0 Support

If you are currently using .NET MAUI you will need to wait a little longer in order to use Xcode 14, as for now we highly encourage you to download Xcode 13.4.1 from the downloads page in the Apple Developer Portal and continue to use it for now.

Thank you for your patience!

The macios team!


Update 0

Apple released Xcode 14.0 on September 12, 2022 we are working to get our Xcode 14 support release out in the meantime if you use Xamarin we recommend you to not upgrade to Xcode 14 just yet and keep using Xcode 13.4.1.

If you updated to Xcode 14, you have 2 options:
1. You can download Xcode 13.4.1 from the downloads page in the Apple Developer Portal and continue to use it.
2. Use a build from our xcode14 branch, this is where our next stable release is coming out and it includes all the iOS 15 SDKs APIs, that said we are still ironing it out.
* xamarin.ios-15.99.0.464.pkg

We will keep this issue updated as we go to have the final builds declared.

If you are currently using .NET MAUI you will need to wait a little longer in order to use Xcode 14, as for now we highly encourage you to use option 1 above.

Thank you for your patience!

The macios team!

@Adam-Langley
Copy link

Hi @dalexsoto
Can you please answer the original question in the original thread #15946 ?

"Where is the definitive source of truth, a page that is kept up to date, indicating compatibility with Xcode?"

Let's resolve the root issue which is the lack of documentation surrounding how to know whether it is safe to do any Xcode upgrade - i.e, a compatibility matrix between the Xamarin, and Xcode releases.

Thanks for your time

@dalexsoto
Copy link
Member Author

Hi @dalexsoto Can you please answer the original question in the original thread #15946 ?

"Where is the definitive source of truth, a page that is kept up to date, indicating compatibility with Xcode?"

Let's resolve the root issue which is the lack of documentation surrounding how to know whether it is safe to do any Xcode upgrade - i.e, a compatibility matrix between the Xamarin, and Xcode releases.

Thanks for your time

As of today for Xamarin packages the major version part matches the iOS version they are meant for, so for example xamarin.ios 16.x.x will be meant to be used with the iOS 16 SDK which is part of Xcode 14. But the true rule of thumb is that you will always want to use the latest Xcode release with the latest stable Xamarin provided by your Visual Studio. The only time it does not entirely apply is when Xcode has major releases where we are always a little behind because we get Xcode the same day as everyone else so we need some time to catch up and produce builds with the latest release.

Thanks!

@grvingit
Copy link

Thank you for this information, I am really grateful to you that I am up and running again. I installed XCode 14 and the problems started. I have uninstalled 14 and installed 13.4.1 and it's all working fine. Touch wood.
I second what Adam-Langley said, this should be clearly documented somewhere, not hidden in a single bug post here.
Just a clear list of current recommended versions of all frameworks.

@filipkristo
Copy link

With option two I have error "failed to compile the generated registrar code" when I want to deploy to device with development provisioning profile. Anyone else have similar error?

@idzikovski
Copy link

idzikovski commented Sep 14, 2022

With option two I have error "failed to compile the generated registrar code" when I want to deploy to device with development provisioning profile. Anyone else have similar error?

Yes, I do. But I guess it makes sense if your phone is still on iOS 15 as mine. I will update to iOS 16 and try it again

@filipkristo
Copy link

With option two I have error "failed to compile the generated registrar code" when I want to deploy to device with development provisioning profile. Anyone else have similar error?

Yes, I do. But I guess it makes sense if your phone is still on iOS 15 as mine. I will update to iOS 16 and try it again

Mine is on iOS 16

@emanuelecastelli
Copy link

emanuelecastelli commented Sep 14, 2022

VS for Mac 17.3.5 with xamarin.ios-15.99.0.464
Xcode 14
iOS 16

I get following build error:
MTOUCH: Error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new (MT4109)

Relevant extract from the build log:

/mtouch-cache/registrar.h:113:9: fatal error: 'CHIP/CHIP.h' file not found
    #import <CHIP/CHIP.h>
            ^~~~~~~~~~~~~
    1 error generated.

@banditoth
Copy link

Happening for me aswell.

@vanyok1991
Copy link

Have the same issue

@timahrentlov
Copy link

+1

@Cheesebaron
Copy link

The +1 and "have same issue" comments are not valuable, use reactions at the opening post.

@timahrentlov
Copy link

The +1 and "have same issue" comments are not valuable, use reactions at the opening post.

+1

@wispborne
Copy link

The Xamarin quickstart page is not accurate as of XCode 14's release: https://docs.microsoft.com/en-us/xamarin/ios/get-started/hello-ios/hello-ios-quickstart?pivots=macos#requirements

iOS development with Xamarin requires:

  • Latest version of Xcode and iOS SDK installed from the App Store .

@tipa
Copy link

tipa commented Sep 14, 2022

Is this for legacy Xamarin only? I did download & install that preview package but still getting an error when trying to compile my .NET6 (non-MAUI) iOS app.

Tool /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/6.0.9/Sdk/../tools/mono-aot-cross execution finished (exit code = 134).
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/15.4.447/targets/Xamarin.Shared.Sdk.targets(1000,3): error : Failed to AOT compile SQLitePCLRaw.provider.sqlite3.dll, the AOT compiler exited with code 134 [/path_to_csproj]

Edit: ignore my comment, my problem is likely related to something else and not the Xcode update

@pm64
Copy link

pm64 commented Sep 14, 2022

@dalexsoto, you closed linked #15946 issue based on this issue, depriving OP @Adam-Langley and many in the community of an answer to his important question: "Where is the definitive source of truth, a page that is kept up to date, indicating compatibility with Xcode?".

Unlike this issue, which relates specifically to Xcode 14, @Adam-Langley seeks to answer a more fundamental question that continues to cost many developers countless hours of trial and error with each new Xcode release.

Please re-open #15946, or provide some response here to his important inquiry: At any point in time, how can we determine the latest compatible Xcode version?

@ivanicin
Copy link

ivanicin commented Sep 14, 2022

@pm64 while I have my own notable remarks on Xamarin that I decided to keep silent at the moment, I do think that this was answered.

Microsoft tries to support the latest version of XCode with the latest version of VS. As XCode may break this without any previous notice there is no practical way to inform people. They just try to issue update as soon as possible.

That’s from me to save some time so that people can work now when they should work and not answer the questions.

@protokovich
Copy link

protokovich commented Sep 14, 2022

17.4.0 Preview 2.0
problem still exists.

XCode 14 & xamarin.ios-15.99.0.464
installed on Mac.

build is ok on simulator. but error on device (iPhone 12 mini iOS 16):

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): error GE71D2E27: no type or protocol named 'BADownloadManagerDelegate'
4>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(235,3): error MT4109: Failed to compile the generated registrar code. Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new

@EduardoReisDev
Copy link

EduardoReisDev commented Sep 14, 2022

I got these two errors when trying to compile a Xamarin project and an iPhone iOS 16.

  • XCode 14
  • Visual Studio 17.3.5
  • Xamarin.iOS 15.99.0.464

image

@dalexsoto
Copy link
Member Author

Ah right, Apple removed the Background Assets framework from Xcode 14 and that build does not account for that just yet, the registrar errors will be gone in the next update.

The other way you can workaround this is by setting the linker to Link SDK assemblies only, this should get rid of the registrar errors.

@EduardoReisDev
Copy link

@dalexsoto, GREAT!!!! Working on a real iPhone and the emulator, both with iOS 16 ✅

@jmmtrimble
Copy link

@dalexsoto Working fine for me too!! Thanks for the solution.

@beeradmoore
Copy link

  1. You can download Xcode 13.4.1 from the downloads page in the Apple Developer Portal and continue to use it.

My 2c on that. This tool isn't from MS (and probably isn't endorsed by them in any way) but for those wanting to easily manage, download, and keep multiple versions of Xcode side by side should check out Xcodes.

Minor version increments of Xcode shouldn't break things, but when it does it is a pain to re-download, extract, etc. So it is super handy to keep them side by side and use this tool to select current active version. Then uninstall when you are happy with stability of the latest version.

VS4Mac also jumps to the correct version of Xcode when you mark them as active within the app so you don't have to go touch that config either.

@amirvenus
Copy link

One tip for developers:

Ensure Automatic Updates is turned OFF within the App Store settings and NEVER actually update anything on your day to day machine until you can test it out completely on another machine/vm first.

@l3bel
Copy link

l3bel commented Sep 22, 2022

Hello,
Thanks everyone for the huge efforts to fix these issues.
I confirm there are no more registrar build errors at this point xamarin.ios-16.0.0.72.pkg. I now have networking related issues with other parts (a nuget), but I think it's that nuget to blame.
Thanks again to everyone who contributed their time and efforts -and still do

@Magic73
Copy link

Magic73 commented Sep 22, 2022

I wrote an article guiding others with the possibilities(using the build from this issue, using Xcodes to backup / handling multiple XCode versions, wait for the update. Please ping me if you have released the update for full support, I'll check periodically myself, too. Updating the article when update has been shipped.

You can find the post here: https://eekayonline.medium.com/fixing-the-xamarin-ios-build-error-mt4109-failed-to-compile-the-generated-registrar-code-8856179427b8

When the💩 hits the fan, it's easy to forget the amount of work being put into keeping up with other crew's stuff. So, here's a shoutout to @dalexsoto and the maintainers of the repo for their quick interaction.

THANKS and looking forward to the update :)

@EeKay I got tons of errors while installing cask xcodes :(

I installed from the zip file directly. (here the Montemagno's video: https://www.youtube.com/watch?v=41h0xIKusT0 )

@EeKay
Copy link

EeKay commented Sep 22, 2022

James Montemago created a YouTube video on How to install Multiple versions of Xcode on your Mac. Once this issue is fixed, we're all going to have to deal with it again when Apple performs another update. This is a simple way to manage releases on our side. https://youtu.be/oC5zpEbwViE

Thanks I'll mention this in my article too! (Also thanks to @Magic73 )

@Magic73
Copy link

Magic73 commented Sep 23, 2022

Anyway, it doesn't work to me. if I install two xcode packages, neither of them work. when I try to start one, it freezes and I have to close it forcibly. It doesn't matter which version I keep active. Xcode only starts working again if I uninstall one of the two versions.
And my problem is not solved, because the version of Visual Studio I have is now too updated compared to the version of xcode I should be using (13.3, with SDK 15.4).

@ivanicin
Copy link

ivanicin commented Sep 23, 2022

I get this when submitting to the App Store:

ITMS-90398: Invalid WatchKit Support - The bundle contains an invalid implementation of WatchKit. The app may have been built or signed with non-compliant or pre-release tools. Visit developer.apple.com for more information.

At this point I don't see any reason for this. I did have a similar problem when I had XCode beta installed, but I don't have it anymore and it worked properly when I uninstalled XCode beta. And searching some more it wasn't exactly the same error.

I'll experiment some more but this looks to be Xamarin problem.

@ivanicin
Copy link

ivanicin commented Sep 23, 2022

I'll experiment some more but this looks to be Xamarin problem.

I did successfully uploaded .ipa file with Watch app (and iOS companion app) created by Xcode. So it seems to be a bug in Xamarin. I see that you have removed bytecode and that the .ipa file is now significantly smaller, but maybe it doesn't work as expected...

@ivanicin
Copy link

ivanicin commented Sep 23, 2022

One warring thing is that I see in the App Center huge pile of these coming from my test device:

Context.Finalize ()
SIGABRT: Linked Away

I don't think that those were crashing the app in use though they are indicated as crashes in AppCenter. Something like this has never happened before Xcode 14.

It could be that this is related to the device connected to the debugger. But again this hasn't happened before and will probably be confusing to any developer.

@dalexsoto
Copy link
Member Author

From Xcode 14.0 release notes:

Deprecations

Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

Xcode no longer builds bitcode by default and generates a warning message if a project explicitly enables bitcode: “Building with bitcode is deprecated. Please update your project and/or target settings to disable bitcode.” The capability to build with bitcode will be removed in a future Xcode release. IPAs that contain bitcode will have the bitcode stripped before being submitted to the App Store. Debug symbols for past bitcode submissions remain available for download. (86118779)

@ivanicin this is related to Xcode 14 but can you please file a separate bug report and fill in the template for this? Looks like we will need to have a deeper look at this.

@ss-proc
Copy link

ss-proc commented Sep 24, 2022

About a timeline we should have manual steps to unblock you any .NET6/MAUI users soon too, I'll reply to this thread as son as we have them.

@dalexsoto Since Apple released iOS 16 to the public, it would be better to not downgrade to Xcode 13. Please let us know when an update will be available for building .NET 7 rc1 + MAUI 7 rc1 + Xcode 14. Thanks!

I got past the build error by following the instructions in dotnet/maui#10234

Currently this is the error that I am getting when running .NET 7 rc1 + MAUI 7 rc1 + Xcode 14:

/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch --launchsim /Users/mycomputer/Desktop/code/csharp/maui/MauiApp02/MauiApp02/bin/Debug/net7.0-ios/iossimulator-x64/MauiApp02.app --device=:v2:udid=A3E3BF1D-0CEC-4FCE-8AE0-BE4DF3126C44 -sdk 16.0 --sdkroot /Applications/Xcode.app/Contents/Developer
error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation' (path: /Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation): 
dlopen(/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation, 0x0001): Library not loaded: '@rpath/ContentDelivery.framework/Versions/A/ContentDelivery'
  Referenced from: '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/DVTITunesSoftwareServiceFoundation'
  Reason: tried: '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/usr/lib/swift/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/lib/mlaunch/mlaunch.app/Contents/MacOS/../Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/Versions/A/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file), '/System/Library/Frameworks/ContentDelivery.framework/Versions/A/ContentDelivery' (no such file)   

@harsh9592
Copy link

I tried xamarin.ios 16.0.
No luck.
App worked fine on emulator iphone 14 ios 16.0
But on physical device iphone 12 ios 16.0. not able to install from enterprise(release mode).(yes my app is on enterprise release and not on app store).
Fyi not able to try debug on iphone 12 ios 16.
Any suggestions?

@RonnyRos
Copy link

No, having the same issues, physical device does not work.

@benspit
Copy link

benspit commented Sep 26, 2022

Same issue, works only on simulators.

@DamianMehers
Copy link

DamianMehers commented Sep 26, 2022

FWIW I'm running on real devices - it did give me an error but when I looked at the "Deploying to device" tab it showed an error re provisioning. Once I'd fixed that (by creating an Xcode project using the same bundle id, signing identity and provisioning profile and then letting Xcode fix everything) it worked.

I'm running Ventura, VS Version 17.3.5 (build 0), Xamarin.iOS Version: 16.0.0.72 - my iPhone is running 16.0.2

@RonnyRos
Copy link

RonnyRos commented Sep 26, 2022

Can confirm @DamianMehers comment works, recreate the project in xcode with the same bundleid, restart your VSMac, it should deploy to your ios 16 device. With .NET 6 targetting.

@ivanicin
Copy link

@DamianMehers this has worked for me without touching anything, but I had to create new provisional profiles as I had some new capabilities. So it is likely that just creating new provisional profiles is enough if that is easier.

@harsh9592
Copy link

harsh9592 commented Sep 27, 2022

Failed.
@DamianMehers ,
I tried with a new provisioning profile and after release on iphone 12 ios16.0.2 via enterprise, it still shows the same error.
'Unable to istall'

When I try to install from the enterprise app store, it starts downloading but after downloading and at time of install, it stops and shows a little cloud icon with a down(download) arrow before the app name, and when I tap on it, it shows an error as mentioned.
Steps i performed:

  1. Created a new provisioning profile from an existing certificate.
  2. Download and add to xcode.
  3. Replaced in vs 2022 17.3.5(build 0).
  4. Closed all and reopened.
  5. Clean and rebuild multiple times, check profile settings again.
  6. Created archive, published on enterprise store.
  7. Download on iphone 12 ios16.0.2
    Error.
    Any steps i missed?
    Any other solution?

@nschoenberg
Copy link

nschoenberg commented Sep 27, 2022

I Installed the 16.0 package pinned at the top.
I tryed to deploy to an attached device that was working before upgrade to XCode 14. I get the following error:
error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation' (path: /Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation). This problem is probably related to the comment of @ss-proc (#15954 (comment))

I'm also unable to see any simulator.

Tips are very welcome, thanks

@kumarc-123
Copy link

kumarc-123 commented Sep 27, 2022

I Installed the 16.0 package pinned at the top. I tryed to deploy to an attached device that was working before upgrade to XCode 14. I get the following error: error HE0004: Could not load the framework 'DVTITunesSoftwareServiceFoundation' (path: /Applications/Xcode.app/Contents/SharedFrameworks/DVTITunesSoftwareServiceFoundation.framework/DVTITunesSoftwareServiceFoundation). This problem is probably related to the comment of @ss-proc (#15954 (comment))

I'm also unable to see any simulator.

Tips are very welcome, thanks

Facing the same issue here

@elomonaco
Copy link

xamarin.ios-16.0.0.72 works like a charm for me, I can now run my xamarin.ios app while still having Xcode 14 installed 😄

appreciate the work you guys put into getting this working, I do native ios development too, so worrying about juggling multiple xcode versions was going to be a hassle.

@awaescher
Copy link

awaescher commented Sep 27, 2022

The update is now available within VS for Mac. Big hugs to everybody that worked on that.

Bildschirmfoto 2022-09-27 um 20 28 33

For me, selecting iOS simulators worked immediately after the update but I could not deploy onto them.
The application output was:

xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
error HE0046: Failed to install the app '...' on the device 'iOS 16.0 (20A360) - iPhone 14 Pro Max': simctl returned exit code 72

The fix was indeed opening Xcode and telling it where its own command line tools are located.

@dalexsoto
Copy link
Member Author

As you found out xamarin.ios-16.0.0.72 is now available in both Visual Studio for Mac and Visual Studio for Windows 17.3.5. Thanks a lot for your patience. I am closing and locking down this issue. The Xcode support for MAUI is still being worked out, I will open a separate issue to track this one.

Again thanks everyone for your patience!

@xamarin xamarin locked as resolved and limited conversation to collaborators Sep 27, 2022
@dalexsoto dalexsoto unpinned this issue Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests