-
Notifications
You must be signed in to change notification settings - Fork 143
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
Microsoft.AppCenter.Crashes clang++ exited with code 1 when compiling for ios-simulator on pair arm64 mac in VS for Windows #1755
Comments
I have the same error for MAUI app with the iOS simulator on Mac since I upgraded to .net 8 |
I got the same problem. |
Same here. After installing dotnet 8 RC1 on the mac I have the same problem when compiling for dotnet 8. |
Hope this will be fixed soon. Very easy to reproduce
|
Same issue when upgrading MAUI workloads from Ultimately the suggestion by the MAUI team on another thread allowed me to build and deploy to an iOS simulator, but not sure if there are any side-effects yet. Have not yet tried on a physical device, or release deployment for that matter. Quick fix: <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE>
</PropertyGroup> For the MS-AppCenter team, the MAUI team suggested the following for the reason for the issue:
|
Experiencing the same issue. |
The build succeeded for me using your steps. Are you building it on intel or m1/m2 mac? |
I am building on a M1 Mac. Make sure it creates and builds the project with .NET 8 - it builds as expected with .NET 7. I just tested again with .NET 8 RC 2 and the error still shows
|
That's intriguing. For Mac users, the issue appears only on .NET 8. However, when building from Windows in conjunction with Mac, it's reproducible on .NET 7. If the problem stemmed from a missing architecture in the AppCenter SDK binary, it would be present across all versions of .NET. I suspect this might be a .NET-related issue. Let's keep this open and gather additional details about this problem. If anyone has a solution or suggestion, contributions are always appreciated! |
It's an AppCenter SDK issue, the problem is that the AppCenter SDK doesn't support arm64 in the simulator. The difference is that in later versions .NET/IDE we've changed the default architecture (RuntimeIdentifier) we build for the simulator when building on an arm64 mac: in initial .NET 6 + .NET 7 releases the default was iossimulator-x64, now (in .NET 8 + some versions of .NET 7 depending on the VS version) it's iossimulator-arm64 when building on an arm64 mac. That's why the workaround works in the IDE: <PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net7.0-ios|AnyCPU'">
<ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE>
</PropertyGroup> It forces using Note that device builds are not affected in any way. |
This has been biting us for a while too as we much prefer to develop using the ARM64 Simulator on our Apple Silicon Macs, but it's currently not possible for dotnet projects - we are either forced to use the x64 sim via Rosetta (using @rolfbjarne's suggested workaround above), or remove references to the AppCenter packages. I suspect a lot of folks don't realise that ARM64 simulator and ARM64 device binaries are two different, non-compatible things & support for both requires bundling XCFrameworks inside the nupkg payloads, containing both the See here for more information (including lots of good stuff from @rolfbjarne) |
It's not a deal breaker, but it'd certainly be nice to be able to run arm64 simulator. When run in x64 mode, the simulator is (imo) a bit slower, and there's a scrolling bug. You can't fling a scrollview or collection (it's an iOS bug but MAUI, same happens in Swift app). Out of all the packages we have only appcenter is not compatible with arm64. What we have is a build profile that removes dependency on AppCenter and in code we check for that build profile so that we don't call any AppCenter APIs. |
Experiencing the same issue. Have to exclude Appcenter from my Solution. |
I tried this doesn't work, but I'm using .NET8 I did this:
|
.NET 8 MAUI? |
agreed i have same issue with .net 8 maui and workaround is not working for me either |
Can you try this out for me please, add this setting, reload your project, close VS and reopen and build again?
|
actually i just had same thought - i simply unloaded project, reloaded and did a rebuild and it launched! So the workaround did work for me once i did reload and rebuild of project. |
Did you add this one: |
No I did not add that line and I confirmed I do not have the RuntimeIdentifier set in the project file anywhere |
This solution has worked for me to fix the issue after updating to .NET8 and MAUI 8. PS. I am using both Microsoft.AppCenter.Crashes and BarcodeScanner.Mobile.Maui nuget packages that do not have the arm64 slice and they work as well. |
I'm working on Mac with M1 so I want to launch my project with ARM64 simulator. So for me this workaround is not suetable. We have just cut the AppCenter from Debug configs
|
Your project code from a couple posts above is putting the simulator runtime identifier for any DEBUG build...so it will be included for both iOS and Android. So yeah, I could see you getting your issue because you are telling the build system to include the simulator runtime identifier on android also. |
Yes, I tried to do that because the builder throws the same clang++ iossimulator error no matter what platform I try to build and deploy to. |
Spent a little more time on it this morning and this now works for me on .Net 8 running on a Mac with Rider IDE. Built and deployed to iOS simulator, iPhone, and Android phone. Omit the other options if they aren't necessary for you.
|
Np, I can understand your frustration quite well. Anyway, please upvote to save others the trouble in the future. :-) |
I've ended up with the workaround shown above eventually. It seems to be the only reliable solution :( |
Oh well... Visual Studio App Center is scheduled for retirement on March 31, 2025. Learn more about support timelines and recommended alternatives. |
It doesn't look like any of the recommend alternatives are related to mobile app crash/error reporting and telemetry? |
I would also like to hear about alternatives for crash/error reporting and telemetry. One Thread with a few suggestions: |
The goal is to automatically attach data that can be useful for debugging problems. Device model etc. What data do you find that affects user privacy? Worth noting you have control of what’s sent. You get the whole object in a callback where you can delete data before it leaves the device. And you can also add filtering rules to run at ingestion time before the data hits disk. Regarding crashes with messages with underlines or missing stack traces. Please raise a ticket so folks can dig into it, I’m unaware of issues matching that in the MAUI SDK for Sentry at the moment: https://github.com/getsentry/sentry-dotnet Sentry invested heavily in MAUI and .NET in general. And adoption indicates folks recognize that https://nugettrends.com/packages?months=72&ids=Sentry&ids=Microsoft.AppCenter Request for line numbers on C# exceptions have been open here for years. Sentry offers that for all platforms including iOS and Android release builds. Debug file upload is convenient with dotnet build (https://docs.sentry.io/platforms/dotnet/configuration/msbuild/) and it includes bindings to native sdks ootb PS: I was the maintainer of the dotnet sdk at sentry |
@bruno-garcia thank you for chipping in, really appreciate it! One more question while you are here, how about one of my comments on Mastodon, that the .NET Sentry SDK seems to (from what I see in the video) be sending crash reports directly rather than saving on disk to be sent at next app startup? |
Regarding the amount of data: Sure that could be interesting but that seems like a huge footprint to add to every events (I like to add many events and usually just want to track a couple of values associated with the event) |
You ended up not pointing out what is concerning regarding user privacy there. I see that as technical detail potentially useful for debugging. Regarding amount, data is compressed before leaving the device and it’s not a lot specially since it’s only in the event of an error. Ultimately as I said you can control what’s sent, so you can keep only the stack trace if you feel that’s right for you. |
It stores it on disk first and deletes it after sending it.
On Android it tries to send it, but only after writing to disk. In my tests if a network connection was already open, for Java exceptions it managed to send immediately. But NDK crashes always only after restart.
C#, Java, Koltin, Swift, C++, Objective-C (any native) crashes will store crash data on disk first. In managed code, it will try to send it immediately (because it can work, not a real OS signal handler , it’s a managed code global error handler). On the native crashes only on app reload data is sent out |
Thank you for your explanations!
There aren't really specific data-points that are directly affecting user privacy, but the combination of some of them may increase the risk of making it possible to identify some users. Regarding footprint, there is also a (minor) concern that the more data you fetch using platform APIs, the bigger risk that these any of these APIs get deprecated and start creating issues (Keep it stupide simple) I am not trying to be negative toward Sentry, I may very well use it in the end. But I have burnt myself in the past using 3:rd party crashlytics tools that made my apps crash and I am just being very cautious. |
Would you mind taking your conversation regarding sentry somewhere private? |
Agreed @markuspalme |
Apologies. I still think other developers may be interested by the discussion so I created #1772 for further discussions about how to move away from AppCenter since it is now announced as retiring in a year. |
As we do not have plans to support net8 and fix this bug in the next year, I'm closing the issue. |
What, wait? No support for .NET 8? Does this mean, AppCenter will never work on .NET MAUI with .NET 8? No TargetFramework net8.0-ios is ever supported? How can I migrate my Xamarin.Forms app to MAUI then? I know that AppCenter is about to retire by 2025, but that's 1 year of additional lifetime from now. |
@thomasgalliker It works, just not in the simulator. You can conditionally disable it in the simulator. |
Just as note to help fellow developers stumbling uppon this issue: Modify your csproj file to force your ios simulator into x64 as given here: https://developercommunity.visualstudio.com/t/Unable-to-build--MAUI-app-for-iOS-with-x/10501186#TPIN-N10501850 |
What solved the issue for me was to setup like this my
|
Description
If you try to use the Microsoft.AppCenter.Crashes in a .net maui app in Visual Studio for Windows paired with an arm64 Mac, deploying to the ios simulator, then you get an error:
Severity Code Description Project File Line Suppression State
Error clang++ exited with code 1:
ld: in /Users/[user]/Library/Caches/Xamarin/mtbs/builds/MauiApp1/baf8b3e6a4f75682439ae911f842ade66bd1741bc02fc255b853516d938283c3/obj/Debug/net7.0-ios/iossimulator-x64/linker-cache/AppCenter.a(MSACAppCenter.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/[user]/Library/Caches/Xamarin/mtbs/builds/MauiApp1/baf8b3e6a4f75682439ae911f842ade66bd1741bc02fc255b853516d938283c3/obj/Debug/net7.0-ios/iossimulator-x64/linker-cache/AppCenter.a' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation) MauiApp1 C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7098\targets\Xamarin.Shared.Sdk.targets 1274
Repro Steps
Details
AppCenter.LogLevel = LogLevel.Verbose
before your call toAppCenter.Start(...)
and include the logs here:The text was updated successfully, but these errors were encountered: