maui: clang++ exited with code 1, error : ld: building for iOS Simulator, but linking in dylib built for iOS
Description
There are a lot of issues about that topic I went over all/most of them but didnt find a solution. I am using the Calculator app with modification to .net7. https://github.com/MikePendo/CalculatorMaui Basically the build is failing with the following:
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7125/targets/Xamarin.Shared.Sdk.targets(1276,3): error : clang++ exited with code 1: [/Users/mr/Desktop/Calculator/src/Calculator/Calculator.csproj::TargetFramework=net7.0-ios]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7125/targets/Xamarin.Shared.Sdk.targets(1276,3): error : ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/mr/Desktop/Calculator/src/Calculator/obj/Debug/net7.0-ios/iossimulator-arm64/linker-cache/Pendo.framework/Pendo' [/Users/mrt/Desktop/Calculator/src/Calculator/Calculator.csproj::TargetFramework=net7.0-ios]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7125/targets/Xamarin.Shared.Sdk.targets(1276,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mr/Desktop/Calculator/src/Calculator/Calculator.csproj::TargetFramework=net7.0-ios]
When running dotnet build Calculator -r iossimulator-arm64 (Running on M1, Xcode 14.3, maui-ios 7.0.101/7.0.100 SDK 7.0.300)
The pendo sdk is a nugget package that is wrapping XCFramewrok. The native framework is build for both device and simultaor(I excluded all the non relevant stuff). I am not sure why it tries to link the wrong architecture when building for simulators.
I have tried some different configurations BUT my knowledge in .net/xamarin/maui is limited. The same framework is used on native/ react / flutter .
Please help or suggest what else can be tried.
Steps to Reproduce
- Take the following sample project https://github.com/MikePendo/CalculatorMaui
- try to build for simulator
dotnet build Calculator -r iossimulator-arm64
Link to public reproduction project repository
https://github.com/MikePendo/CalculatorMaui
Version with bug
7.0.101
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No
Relevant log output
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7125/targets/Xamarin.Shared.Sdk.targets(1276,3): error : clang++ exited with code 1: [/Users/mr/Desktop/Calculator/src/Calculator/Calculator.csproj::TargetFramework=net7.0-ios]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7125/targets/Xamarin.Shared.Sdk.targets(1276,3): error : ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/mr/Desktop/Calculator/src/Calculator/obj/Debug/net7.0-ios/iossimulator-arm64/linker-cache/Pendo.framework/Pendo' [/Users/mrt/Desktop/Calculator/src/Calculator/Calculator.csproj::TargetFramework=net7.0-ios]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7125/targets/Xamarin.Shared.Sdk.targets(1276,3): error : clang: error: linker command failed with exit code 1 (use -v to see invocation) [/Users/mr/Desktop/Calculator/src/Calculator/Calculator.csproj::TargetFramework=net7.0-ios]
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Comments: 17 (6 by maintainers)
That strange the framework has the proper arch for device and simulators…