maui icon indicating copy to clipboard operation
maui copied to clipboard

[META] Xcode 15.3 Support for .NET 8 and MAUI

Open jfversluis opened this issue 11 months ago • 13 comments

Below text is copied from the .NET for iOS repository (see here). TL;DR Xcode 15.3 is not supported at this time.


Hello!

Xcode 15.3 was released on March 5, 2024. We are in the process of updating our bindings and our infra in order to support this release.

As of the time of this post, Xcode 15.3 is not recommended to be used with our .NET MAUI or Xamarin SDKs so our advise is not to install it just yet and keep using Xcode 15.2 for the time being.

If you need to download Xcode 15.2 you can get it from the Apple Developer portal.

Known issues

iOS 17.4 Simulator crashes

Workaround: Use Xcode 15.2. If you really need to use Xcode 15.3 then either use iOS Simulator 17.2 or the workaround provided in https://github.com/dotnet/runtime/issues/98941.


We'll keep this post updated as we learn more.

Thank you!

-The macios team (and .NET MAUI team 😄 )

jfversluis avatar Mar 06 '24 15:03 jfversluis

this is highly necessary - a number of other issues make using 15.3 necessary (can't even debug the iOS app without it), but now it seems that a bunch of bits are entirely broken when using 15.3, in my case mostly around globalization.

MitchBomcanhao avatar Mar 07 '24 09:03 MitchBomcanhao

When this is fixed, please update .github/DEVELOPMENT.md so the dev guide doesn't contraindicate Xcode 15.3.

stephen-hawley avatar Mar 26 '24 20:03 stephen-hawley

It should be great to have this informations on the .Net MAUI Output of visual studio code! We already have Android sdk version displayed

Output:

Android components:
	- Java SDK (version: '11.0.22'): installed.
 
	Android SDK recommended required components:
	- platforms/android-34 (version: '3'): installed.
	- build-tools/34.0.0 (version: '34.0.0'): installed.
	- platform-tools (version: '35.0.1'): installed.
	- cmdline-tools/11.0 (version: '11.0'): installed.
 
	Android SDK recommended optional components:
	- emulator (version: '34.1.19'): installed.
	- system-images/android-34/google_apis/x86_64 (version: '8'): installed.
	- system-images/android-33/google_apis_playstore/x86_64 (version: '7'): installed.

We could add informations about Xcode/Android sdk compatibilities? Orange or Red flag on versions, should inform us. A link with the current issue to follow on github would be really appreciated!

Phenek avatar Apr 01 '24 19:04 Phenek

Hi,

installing Xcode 15.2 and using the simulator iOS 17.2 works great for debugging and local deployment.

However, uploading the app to the App Store fails the review process:

We were unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.

Review device details:

  • Device type: iPhone 14 Pro
  • OS version: iOS 17.4

So I guess on the App Store they use a simulator with iOS 17.4, which then crashes.

Any help or ideas is appreciated.

Thank you Arnold

AOgai avatar Apr 05 '24 08:04 AOgai

@AOgai, I'm curious, have you attempted to run a release build on your local emulator to see if it also crashes? It's worth investigating because crashes upon app launch often occur in release builds (but not in debug builds) when the interpreter isn't utilized. For further insights, you might want to check out these issues:

AndreKraemer avatar Apr 08 '24 06:04 AndreKraemer

@AOgai, I'm curious, have you attempted to run a release build on your local emulator to see if it also crashes? It's worth investigating because crashes upon app launch often occur in release builds (but not in debug builds) when the interpreter isn't utilized. For further insights, you might want to check out these issues:

@AndreKraemer: Release build on emulator iOS 17.2 works fine.

Release build on emulator iOS 17.4 crashes with following message:

Xamarin-Simulator UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <_UIMoreListTableView: 0x111ae6200; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x600000c8ae20>; backgroundColor = <UIDynamicSystemColor: 0x600001748f00; name = tableBackgroundColor>; layer = <CALayer: 0x6000005bbc60>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}; dataSource: <UIMoreListController: 0x10d42e840>>

The interpreter workarounds didn't work for me.

What worked for me was adding this from Issue 98941:

<PropertyGroup>
	<_LibXamarinLinkMode>static</_LibXamarinLinkMode>
	<_LibMonoLinkMode>static</_LibMonoLinkMode>
</PropertyGroup>
<Target Name="_FixMonoLinkMode" AfterTargets="_MonoReadAvailableComponentsManifest">
	<ItemGroup>
		<_MonoRuntimeComponentLinking Remove="dynamic" />
		<_MonoRuntimeComponentLinking Include="static" RuntimeIdentifier="ios-arm64" />
		<_MonoRuntimeComponentLinking Include="static" RuntimeIdentifier="iossimulator-arm64" />
		<_MonoRuntimeComponentLinking Include="static" RuntimeIdentifier="iossimulator-x64" />
	</ItemGroup>
</Target>

Edit: I think <_MonoRuntimeComponentLinking Include="static" RuntimeIdentifier="ios-arm64" /> is maybe not needed.

AOgai avatar Apr 08 '24 11:04 AOgai

Edit: I think <_MonoRuntimeComponentLinking Include="static" RuntimeIdentifier="ios-arm64" /> is maybe not needed.

With that line included I receive the following error when trying to publish:

Value of _MonoRuntimeComponentLinking for 'ios-arm64' must be 'dynamic' or 'static' it is 'static;static'. Malformed runtime pack?

I had to remove that line to get it to publish.

jdarwood007 avatar Apr 09 '24 19:04 jdarwood007

Please Fix this ASAP!! Updated: "Actually the fix involving changing the iOS emulator version to 17.2 was easy... and worked well"

pierre01 avatar Apr 13 '24 09:04 pierre01

Hi Use this one if you want to have multiple version of Xcode or just 2 minutes install instead of 30 minutes.

https://www.xcodes.app

//Joacim

JoacimWall avatar Apr 18 '24 17:04 JoacimWall

15.4 beta 1 has now been released for a few days. by the time whatever fix is done to get 15.3 supported, 15.4 or 15.5 or who knows which version will already be available and probably also not working.

MitchBomcanhao avatar Apr 22 '24 12:04 MitchBomcanhao

Unacceptable response times...

stemig avatar Apr 27 '24 09:04 stemig

Is there any progress related to this issue ? Our production app does not work in 15.3 and users are complaining it's crashing.

malsabi avatar May 02 '24 07:05 malsabi

I managed to get an App onto testflight after removing all the CSS from the project, which turned out to be the cause of weird xaml errors that would crash the app on device or release testing...... not sure why CSS is no longer valid as worked fine for 6 months...

Oh well only took 1.5 weeks to find the issue and missed a client deadline

mattlovell avatar May 05 '24 15:05 mattlovell

@jfversluis Can you give an update when this is available?

imuller avatar May 06 '24 14:05 imuller

@imuller subscribe to this issue and when it's closed there probably will be a comment with an update and then it will probably be available as well of have information when it will be!

jfversluis avatar May 06 '24 15:05 jfversluis

Do we have an ETA on this?

Richard-Starrtec avatar May 09 '24 23:05 Richard-Starrtec

Can confirm .NET 8.0.5 fixes this for us.

zacharykeeping avatar May 16 '24 01:05 zacharykeeping

Can confirm .NET 8.0.5 fixes this for us.

Thank you for trying the new servicing release. The .NET 8.0.5 contains the fix for https://github.com/dotnet/runtime/issues/98941, thanks for verifying that it works. This should unblock the Xcode 15.3 support. FYI: @jfversluis

matouskozak avatar May 16 '24 07:05 matouskozak

I updated to .NET 8.0.5 and It's still crashing on 17.4 Simulator but on 15.5 it's working completely fine.

malsabi avatar May 17 '24 05:05 malsabi

So, is it already possible to do the update to 15.3 using latest nightly builds, or better still wait?

MAUIoxo avatar May 17 '24 18:05 MAUIoxo

With Xcode 15.4 now available, can you provide us with an update on this please?

HansenPeter avatar May 27 '24 12:05 HansenPeter

Does this affect running apps on android emulators on Mac?

Take-A-Byte avatar May 28 '24 12:05 Take-A-Byte

Does this affect running apps on android emulators on Mac?

No, this issue is about iOS. I've got nothing but sympathy for the small team at MS working on this, but would love to know some order-of-magnitude timeline as we devs are bound to such timelines to our own bosses. Is it weeks? months? days?

somoreingold avatar May 28 '24 13:05 somoreingold

With the release of .NET 8.0.300 all should be resolved here and you should be able to use Xcode 15.3 and 15.4 without any issues.

The .NET for iOS team is working on making all new APIs that came with Xcode 15.3+ available. To track the progress, please refer to this issue: https://github.com/xamarin/xamarin-macios/issues/20257

Any issues with this will likely need to be reported to the .NET for iOS repository (see link just above here).

I'm closing this issue here as the most pressing issue, crashing builds, should now be over.

jfversluis avatar May 28 '24 13:05 jfversluis

I still experience a crash in my MAUI app using Xcode 15.3 or 15.4.

*** error for object 0x127d3fe64: pointer being freed was not allocated <my_app_name>(62073,0x307ed4000) malloc: *** set a breakpoint in malloc_error_break to debug

Moving back to using Xcode 15.2 avoids the problem.

I haven't yet narrowed down what triggers the crash, but it is not occurring at a certain point in my MAUI code - it occurs at various times during startup.

I will try to find the source of the issue, probably by removing startup related code, xaml, etc. until it doesn't crash, and will open a new bug if I can get to that point. However, adding this in case anyone else has hit the same mysterious problem.

kpespisa avatar May 28 '24 15:05 kpespisa

I still experience a crash in my MAUI app using Xcode 15.3 or 15.4.

*** error for object 0x127d3fe64: pointer being freed was not allocated <my_app_name>(62073,0x307ed4000) malloc: *** set a breakpoint in malloc_error_break to debug

Moving back to using Xcode 15.2 avoids the problem.

I haven't yet narrowed down what triggers the crash, but it is not occurring at a certain point in my MAUI code - it occurs at various times during startup.

I will try to find the source of the issue, probably by removing startup related code, xaml, etc. until it doesn't crash, and will open a new bug if I can get to that point. However, adding this in case anyone else has hit the same mysterious problem.

This looks like a similar error to this one, however we would need to see the stack trace to confirm. You can check https://github.com/dotnet/runtime/issues/98941 to see if the stack trace looks similar. If that is the case, I would recommend verifying that your MAUI app is using the 8.0.5 .NET runtime as it might still be using the older version due to caching, etc.

matouskozak avatar May 29 '24 06:05 matouskozak