Closed odanu closed 3 years ago
Here are some screenshots from the Main and Test target configuration.
Main Target
Test Target
Played with the configurations today and nothing helped. I updated the screenshots with the last state of the dependency integration picture... still having the same issue.
Worth to mention that we are using Standard Architecture, no Valid Architecture
setting is there Excluded Arcchitecture
is also empty. Building Active Architecture Only
for the Test target.
Attaching a small reproducible project. Root/Frameworks folder contains placeholders for the frameworks.
I managed to find a workaround.
Since xcode tools have difficulties selecting the right architecture slice, I just manually removed the ios-arm64_armv7
slice from XCFrameworks.
I though it is safe to do it, since I only deleted the slices from RxBlocking and RxTest - frameworks which are only used for unit testing in our project and we run the tests only on simulator.
That seems like a reasonable solution but I'm confused with why Xcode itself didn't get rid of the slices it didn't need. This is literally what the XCFramework format is meant for 🤔
Obviously, it's either an XCode bug or we are missing something.
I built it on an M1 Mac, which I wonder if related. If you're curious and want to try, install this: https://github.com/unsignedapps/swift-create-xcframework
(using mint install unsignedapps/swift-create-xcframework
)
And run:
swift create-framework --output xcframeworks RxTest RxBlocking
I'm wondering if building locally will matter at all.
If you're curious and want to try, install this:
I am curious and would be happy to help, but I don't have mint
installed and it looks like it's not a simple step, which I would like to avoid.
Installed the tool manually as described in the specific section using make install
... but than, I had issues executing the command.
It seems it's just:
brew install mint
Unless you don't have Homebrew installed at all :)
Hmm I tried the other one before...
brew tap mint-lang/mint-lang
brew install mint-lang
But it didn’t work. Will try your suggestion tomorrow ;)
Yeah I got confused as well, that's a programming language called mint
as opposed to the package manager called Mint
🤦
Thanks!
I managed to generate the xcframeworks, but using swift create-xcframework...
, I guess it was a typo on your side.
But in the end, the result was the same. Same slices were included in the package and XCode couldn't pick the right one.
I'm not seeing anything that we can do here since it seems like an issue with the compiler/linker choosing the wrong slices, which isn't something we can affect. My instinct would be to file a bug on https://bugs.swift.org . I'd do so myself but I can't easily reproduce with your sample project (getting plist-related compilation errors).
You can go back to fat frameworks done by lipo and: You can try to set Validate Workspace on build settings to Yes (NOT Yes(Error)) try again. It will change errors to warnings for multiple archs.
I got similar issues that im thinking of filing a separate bug on.
When i build Rx Swift with carthage 0.37 i get xcode 12.4 complaining about missing architectures for simulator (intel). When i use the precompiled framework thats included with rxswift 6.1.0, xcode complains about linker issues even thrugh my search path is setup.
Will link the bug that i am going to create once i well and truly give up.
Sorry, but have to close this mainly due to the fact we can't possibly fix Apple's tooling. If there's an advancement in this issue from Apple's side that requires us doing something, I'm happy to reopen.
Thanks!
This indeed seems to be an Apple tooling issue. However, in case someone ends up on this issue report in the search of a workaround: a tad simpler to manage workaround alternative to @odanu's workaround to remove the non -simulator
subfolder in the respective .xcframework
folders, is to change in the build settings of your test target FRAMEWORK_SEARCH_PATHS, so that you have the full path to the -simulator
folder, e.g. $(PROJECT_DIR)/Carthage/Build/RxTest.xcframework/ios-arm64_i386_x86_64-simulator
, precede the inherited general project search paths:
It achieve effectively the same result—cluing in Xcode where to find the simulator slices, but without the need for manual changes of the Carthage/Build
contents.
Short description of the issue:
I am having an issue with integrating manually the XCFrameworks in the Test Target.
Expected outcome:
Be capable to run tests using RxTests and RxBlocking.
What actually happens:
Getting errors:
RxSwift/RxCocoa/RxBlocking/RxTest version/commit
6.1.0
Platform/Environment
How easy is to reproduce? (chances of successful reproduce after running the self contained code)
Xcode version:
Installation method:
I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)
Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)