Closed brentjensen closed 2 years ago
Forgot to mention. I'm configured to use Resolver 1.4.1 in Swift Package Manager.
Looking into this as just got an M1 machine.
I also experienced this issue on M1 mac, it turned out that Resolver is not the cause of the problem after all. I had one binary-only pod which is not compatible with arm64 simulator, and it was the problem. Excluding this pod solved the problem. In the end, I added build configuration only for simulator without that binary-only pod.
same here but via cocoapods
I managed to create a universal xcframework to fix this. The steps will hopefully help you resolve it in a way that doesn't force so many compromises, or others having this issue can follow these steps for a temporary workaround. Most of these steps were required because of the restrictions of XCFramework, so if you can, it would be much better to figure out how to get lipo to combine two arm64 frameworks (Apple Silicon Simulator and iOS builds will both contain this architecture).
There are a lot of steps here, but they should take only about 10 mins or less to complete.
BUILD_LIBRARY_FOR_DISTRIBUTION = YES
(this generates to swift interface files required for xcframework)TARGET_NAME
to Resolve
(instead of "Resolver"). The definition of an xcframework confuses the compiler when a class is named the same thing as its module. The product module name is configured to rely on this user defined build setting TARGET_NAME
.Resolver.swift
, import Combine
right above the definition for the struct InjectedObject
, but inside the #if
directive. (Otherwise, the xcframework swift definition file gets really confused about using Combine.ObservableObject because it chooses to fully qualify this symbol, instead of using the alias found in Foundation)cmd-shift-comma
).Products
folder, right-click on the Resolve
framework, and select Show in Finder
. This will allow you to copy the two Resolve.framework
folder paths for the next step.xcodebuild -create-xcframework \ -framework "<YOUR_BUILD_PATH>/Release-iphonesimulator/Resolve.framework" \ -framework "<YOUR_BUILD_PATH>/Release-iphoneos/Resolve.framework" \ -output "<YOUR_BUILD_PATH>/Universal/Resolve.xcframework"
Resolve.xcframework
to the location where you'll want it for your project, remove your existing Resolver, and then drag this xcframework into your Project Navigator (you don't need Copy items, but make sure each target you want to use Resolver in is checked in the modal dialog that appears).Oh, and of course this module name change means you'll need to import Resolve
everywhere you had import Resolver
Any news about this issue?
When you try to build for x86_64 simulator, Resolver can't be found, because it does not appear to be built for this architecture. Is there a way to add this to the supported architectures?
To reproduce: