Error: Unable to find matching slice for arm64
Checklist
- [x] Updated the plugin to the latest version
- [x] I've read the Contribution Guidelines
- [x] I've searched for existing GitHub issues
Issue Description
Command executed
bundle exec pod binary prebuild && bundle exec pod deintegrate && bundle exec pod install
What went wrong?
When I open my workspace and compile my target for iPhone SE simulator on my M1 MacBook, Xcode fails with:
ld: framework not found RTSettings
And then there is this warning for the RTSettings aggregate target (my pod dependency where I turned on binary cache):
warning: [CP] RTSettings.xcframework: Unable to find matching slice in 'ios-arm64 ios-x86_64-simulator' for the current build architectures (arm64) and platform (-iphonesimulator).
Why is ios-arm64-simulator slice missing?
I'm getting the same error with Xcode 13.4.1 and 14.2
Podfile
plugin 'cocoapods-binary-cache'
config_cocoapods_binary_cache(
cache_repo: {
"default" => {
"remote" => "ssh://git@.../cocoapods-binary-cache.git",
"local" => "~/.cocoapods-binary-cache/"
}
},
excluded_pods: ["CocoaLumberjack"],
bitcode_enabled: true,
device_build_enabled: true,
xcframework: true
)
platform :ios, '13.0'
inhibit_all_warnings!
use_frameworks!
source 'ssh://git@...'
source 'https://cdn.cocoapods.org/'
target 'PlaygroundSimple' do
pod 'runtastic-iphone-settings', '~> 2.0', :binary => true
target 'UnitTests' do
end
end
Stack trace
[Details go here]
Environment
Xcode 13.4.1 and Xcode 14.2 macOS Monterey 12.6.2 (21G320)
Plugin version
Using cocoapods-core 1.11.3 Using cocoapods 1.11.3 Using cocoapods-binary-cache 0.1.14
Installed CocoaPods plugins
Installed CocoaPods Plugins:
- cocoapods-binary-cache : 0.1.14 (pre_install and post_install hooks)
- cocoapods-deintegrate : 1.0.5
- cocoapods-plugins : 1.0.0
- cocoapods-run-scripts : 1.0.1 (pre_install and post_install hooks)
- cocoapods-search : 1.0.1
- cocoapods-simplifier : 1.2.0
- cocoapods-trunk : 1.6.0
- cocoapods-try : 1.2.0
turns out adding arm64 architecture to the build arguments solved also my issue. (see solution)
config_cocoapods_binary_cache(
...
build_args: {
:simulator => [
"ARCHS='x86_64 arm64'" # or "ARCHS=arm64", I'm assuming the default simulator arch on M1 mac is arm64
]
}
)
but I am wondering why arm64 isn't added to the list per default by the plugin itself? Our developers in our company are getting more and more M1 Macbooks. Since Apple doesn't sell Intel Macs anymore, the numbers will only grow over time.
So it would make sense to add arm64 per default right?
Pods successfully build but when run on M1 iOS Simulator results in error build: Building for iOS Simulator, but linking in dylib built for iOS, file '/Pods/Alamofire/_Prebuilt/Alamofire.framework/Alamofire' for architecture arm64
Here is my working settings in podfile
config_cocoapods_binary_cache(
cache_repo: {
"default" => {
"local" => "~/.cocoapods-binary-cache/prebuilt-frameworks"
}
},
prebuild_config: "PodCache",
device_build_enabled: true,
build_args: {
:simulator => [
"ARCHS='x86_64 arm64'"
]
},
xcframework: true
)