I am developing a mobile app in .NET Maui with .NET 8.0 for both Android and iOS using the latest Release of Visual Studio 2022 and a Windows PC. Everything worked very well until this week. I can no longer build a Release *.ipa file for iOS. Building a Signed Bundle for Android still works fine. I only made minor code changes which should not affect building the Solution in Visual Studio.
I build as always: select "Release" version, configure "Remote Device", make sure the developer Mac is paired with Visual Studios, make sure all settings are correct, certificates are still valid, etc.
I use Visual Studio 2022 17.14.7 Preview 1.0 on my PC (I also tried the Release version, same problem) and I use XCode 16.4 on the developer Mac which is paired to Visual Studio.
The exact error I get is
clang++ exited with code 1:
ld: file is empty in '/Users/[REDACTED]/Library/Caches/Xamarin/mtbs/builds/[REDACTED]/22c62288292fded39a87e7ea4336f31660288f43a61bfc1e16a2fae321abefa6/C:/Program Files/dotnet/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/8.0.17/runtimes/ios-arm64/native/libmono-component-hot_reload-static.a'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
I have investigated this issue and I found different solutions online. None of them worked for me.
Here are my attempts that did not have any effect:
- I configured ForceSimulatorX64ArchitectureInIDE in the Visual Studio project's configuration as described here or here.
- I configured iossimulator-x64 as RuntimeIdentifier in the Visual Studio project's configuration as described here and here.
- I cleared the cache on the Mac in the folder ~/Library/Caches/Xamarin/XMA/SDKs/dotnet/ and I did the same for the PC in the folder %localappdata%\Temp\Xamarin\XMA as described here and here.
- I also tried adding the NuGet package Microsoft.Identity.Client.Extensions.Msal as described here although it felt like a wide shot.
- Deleting all bin and obj folders as described here was actually my first try.
- I tried installing different versions of XCode on the Mac. 15.4 is outdated and not supported anymore. 16.0, 16.2, and 16.4 have all the same problem.
- I also restarted Visual Studio, my PC and my Mac often.
When checking the path on the Mac, I found that an object at this path existed: /Users/[REDACTED]/Library/Caches/Xamarin/mtbs/builds/[REDACTED]. But they tool tip showed it as a broken App. Deleting it and retrying the Build did also not succeed.
Does anyone have an idea what else I could try? As mentioned before, I did work perfectly fine a few weeks ago when I made the last Release Build. Since my PC has not changed, I assume it must be related to an updated Mac version?