xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.42k stars 507 forks source link

Xcode 15.3/4 and .NET 8.0.6 and .NET SDK 8.0.302 simulator crash #20734

Closed tpitman closed 1 week ago

tpitman commented 1 week ago

Steps to Reproduce

  1. Start with a project upgrade from Xamarin by creating a new MAUI project and importing / modifying all files to build
  2. Start with MAUI 8.0.101 & .NET 8.0.1
  3. Start with xcode 15.3
  4. Build and run in the simulator and see that all is working
  5. Download and install .NET SDK 8.0.302
  6. Note that SDK is now 8.0.302 and .NET runtime is 8.0.6
  7. Build and run in the simulator and see that the app crashes

Expected Behavior

No crash

Actual Behavior

Crash

Environment

Version information ``` Visual Studio Enterprise 2022 for Mac Version 17.6.12 (build 410) Installation UUID: 9ba19677-64d9-45bc-9eb9-199ef1e975d0 Runtime .NET 7.0.3 (64-bit) Architecture: Arm64 Microsoft.macOS.Sdk 13.1.1007; git-rev-head:8afca776a0a96613dfb7200e0917bb57f9ed5583; git-branch:release/7.0.1xx-xcode14.2 Roslyn (Language Service) 4.6.0-3.23180.6+99e956e42697a6dd886d1e12478ea2b27cceacfa NuGet Version: 6.4.0.117 .NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/8.0.302/Sdks SDK Versions: 8.0.302 8.0.101 7.0.316 7.0.314 6.0.422 6.0.420 MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks .NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 8.0.6 8.0.1 7.0.19 7.0.17 6.0.30 6.0.28 Xamarin.Profiler Version: 1.8.0.49 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler Updater Version: 11 Apple Developer Tools Xcode: 15.3 22618 Build: 15E204a Xamarin.Mac Version: 9.3.0.23 Visual Studio Enterprise Hash: 9defd91b3 Branch: xcode14.3 Build date: 2023-10-23 16:14:59-0400 Xamarin.iOS Version: 16.4.0.23 Visual Studio Enterprise Hash: 9defd91b3 Branch: xcode14.3 Build date: 2023-10-23 16:15:00-0400 Xamarin Designer Version: 17.6.3.9 Hash: 2648399ae8 Branch: remotes/origin/d17-6 Build date: 2024-05-09 04:36:07 UTC Xamarin.Android Version: 13.2.2.0 (Visual Studio Enterprise) Commit: xamarin-android/d17-5/45b0e14 Android SDK: /Users/tpitman/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 12.0 (API level 31) 8.1 (API level 27) 11.0 (API level 30) 10.0 (API level 29) 9.0 (API level 28) 13.0 (API level 33) 7.0 (API level 24) SDK Command-line Tools Version: 7.0 SDK Platform Tools Version: 34.0.3 SDK Build Tools Version: 33.0.0 Build Information: Mono: d9a6e87 Java.Interop: xamarin/java.interop/d17-5@149d70fe SQLite: xamarin/sqlite/3.40.1@68c69d8 Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d Microsoft Build of OpenJDK Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk 11.0.21 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Eclipse Temurin JDK Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk 1.8.0.302 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL Android SDK Manager Version: 17.6.0.50 Hash: a715dca Branch: HEAD Build date: 2024-05-09 04:36:12 UTC Android Device Manager Version: 0.0.0.1309 Hash: 06e3e77 Branch: HEAD Build date: 2024-05-09 04:36:12 UTC Build Information Release ID: 1706120410 Git revision: 2f8e0518dd80a933901821bac53f7398d4b61c0f Build date: 2024-05-09 04:34:23+00 Build branch: release-17.6 Build lane: release-17.6 Operating System Mac OS X 14.5.0 Darwin 23.5.0 Darwin Kernel Version 23.5.0 Wed May 1 20:12:58 PDT 2024 root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64 Enabled user installed extensions Meadow for VS2022 1.9.6 ```

Build Logs

msbuild.binlog.zip

rolfbjarne commented 1 week ago

Can you attach the application output / crash report/stack trace?

tpitman commented 1 week ago

I would love to. Haven't been able to figure out how to get them for the simulator.

I looked in the information at this page: https://github.com/xamarin/xamarin-macios/wiki/Diagnosis#build-logs

Under the Crash reports sections it talks about the ~/Library/... folder having crash reports for MacOS, but for devices it says to use the console, but the console doesn't allow me to connect to the simulator as far as I can tell.

Please advise on steps to get the right logs.

rolfbjarne commented 1 week ago

Which IDE are you using? There should some way to see the app's output.

Under the Crash reports sections it talks about the ~/Library/... folder having crash reports for MacOS,

"Crash reports for macOS, Mac Catalyst and apps in the simulator can be found in the ~/Library/Logs/DiagnosticReports directory."

tpitman commented 1 week ago

I am using VS for Mac 2022.

I found one crash report in that folder from about the time I ran the app and it crashed this morning, but it doesn't seem to say anything about my app. I made it crash again and no new reports showed up.

I have attached that report in case it is in fact the correct report you want.

As far as getting information in the IDE, the app crashes before VS even attaches to the debugger, so output in the IDE is useless.

mediaanalysisd-2024-06-17-072742.ips.zip

rolfbjarne commented 1 week ago

Can you create a new project from a template and launch that successfully?

rolfbjarne commented 1 week ago

Actually try deleting this file to see if that makes a difference:

/Users/tpitman/Projects/Holley/Software_mobile/Powerteq/Parallax/ParallaxMAUI/Parallax.csproj.user

It sets RuntimeIdentifier=ios-arm64, which means you're building for device. Launching such a build in a simulator won't work.

tpitman commented 1 week ago

I had already created a new app from a template and it runs fine on the simulator.

I then read your next comment and removed that file. When I tried to build I got a bunch of errors. I then removed the obj and bin folders and built again. This time it built and ran on the simulator (YAY).

I then built and ran on my actual device and that seems to work.

Looks like there is some hold over information in the user project file. Probably want to have VS or something check for that and/or at least document it so devs know they need to remove things like that.

Might also be nice to be able to just remove the bad parts from the user project file because I don't have all my other user settings anymore for this project. I probably won't miss them, but some devs might.

Bottom line is that fixed my issue.

Thank You !!!!