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.46k stars 512 forks source link

[Simulator] ld: building for iOS Simulator, but linking in dylib built for iOS #21328

Closed Kebechet closed 3 weeks ago

Kebechet commented 3 weeks ago

Apple platform

iOS

Framework version

net8.0-*

Affected platform version

.net 8.0.400

Description

Severity    Code    Description Project File    Line    Suppression State   Details
Error (active)      clang++ exited with code 1:
ld: building for iOS Simulator, but linking in dylib built for iOS, file '/Users/samuelsidor/Library/Caches/Xamarin/mtbs/builds/DemoApp/755a3b6dfd6e3e76b815d6f2431b30e382f0c28d824ac6d2fcc4c4f647c4ce91/obj/Debug/net8.0-ios/iossimulator-arm64/linker-cache/RevenueCat.framework/RevenueCat'
clang: error: linker command failed with exit code 1 (use -v to see invocation) DemoApp (net8.0-ios)    C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk.net8.0_17.5\17.5.8030\targets\Xamarin.Shared.Sdk.targets    1641        

We cant build and run app using this package on simulator. Production release on real device works

Steps to Reproduce

1) Download repo https://github.com/Kebechet/Maui.RevenueCat.InAppBilling 2) Open demo/DemoApp/DemoApp.sln 3) Connect to mac (in my case with M1) 4) Open simulator 4) Try to build the project. It will fail on this mistake

Did you find any workaround?

no

Build logs

No response

Kebechet commented 3 weeks ago

swapping .framework for .xcframework resolved the issue