所以我从GitHub克隆了一个现有的存储库,并在我的设备上尝试了pod (MacBook Pro M1 2020 bigSur 11.6和Xcode 13) Cocoapods没有按预期工作,所以我在网上查了一下,在尝试使用Rosetta打开并安装ffi gem后,我设法安装了大部分pod。然而,这两个错误一直出现:
- 没有这样的模块'MapboxCommon_Private' 创建MapboxSearch模块失败;编译器不支持此SDK (SDK是用"Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)"构建的,而此编译器是"Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)")。请选择与SDK匹配的工具链。
pod文件如下所示:
platform :ios, '14.3'
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['ARCHS[sdk=iphonesimulator*]'] = `uname -m`
end
end
end
target 'Project' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Proiect
pod 'RxSwift'
pod 'RxCocoa'
pod 'Moya/RxSwift'
pod 'XCoordinator', '~> 2.0'
pod 'Reusable', '~> 4.1.1'
pod 'SideMenu', '~> 6.0'
pod 'GoogleSignIn', '~> 5.0'
pod 'FacebookLogin'
pod 'FBSDKLoginKit'
pod 'NotificationBannerSwift'
pod 'Moya/RxSwift'
pod 'NVActivityIndicatorView', '~> 4.8.0'
pod 'CountryPickerView'
pod 'SwiftGen', '~> 6.0'
pod "RxGesture"
pod 'Mapbox-iOS-SDK', '~> 6.2.1'
pod 'XLPagerTabStrip', '~> 9.0'
pod 'DropDown'
pod "CenteredCollectionView"
pod 'RealmSwift'
pod "RxRealm"
pod 'MapboxSearch', ">= 1.0.0-beta.2", "< 2.0"
pod 'XLPagerTabStrip', '~> 9.0'
pod 'Wormholy', :configurations => ['dev debug', 'dev release']
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'JWTDecode', '~> 2.6'
pod 'CryptoSwift', '~> 1.4.0'
pod 'DPOTPView'
target 'Tests' do
inherit! :search_paths
# Pods for testing
end
target 'UITests' do
# Pods for testing
end
end
我还试图将Xcode版本降级到Xcode 12.5.1,并使用以下pod文件,我得到了另一个错误:
- 未能构建模块"MapboxSearch"从其模块接口;它可能已经损坏,或者它可能在生成时触发了Swift编译器中的错误
pod文件:
# Uncomment the next line to define a global platform for your project
platform :ios, '14.3'
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['ARCHS[sdk=iphonesimulator*]'] = `uname -m`
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
target 'Proiect' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Proiect
pod 'RxSwift'
pod 'RxCocoa'
pod 'Moya/RxSwift'
pod 'XCoordinator', '~> 2.0'
pod 'Reusable', '~> 4.1.1'
pod 'SideMenu', '~> 6.0'
pod 'GoogleSignIn', '~> 5.0'
pod 'FacebookLogin'
pod 'FBSDKLoginKit'
pod 'NotificationBannerSwift'
pod 'Moya/RxSwift'
pod 'NVActivityIndicatorView', '~> 4.8.0'
pod 'CountryPickerView'
pod 'SwiftGen', '~> 6.0'
pod "RxGesture"
pod 'Mapbox-iOS-SDK', '~> 6.4.0'
pod 'XLPagerTabStrip', '~> 9.0'
pod 'DropDown'
pod "CenteredCollectionView"
pod 'RealmSwift'
pod "RxRealm"
pod 'MapboxSearch', ">= 1.0.0-beta.6", "< 2.0"
pod 'XLPagerTabStrip', '~> 9.0'
pod 'Wormholy', :configurations => ['dev debug', 'dev release']
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'JWTDecode', '~> 2.6'
pod 'CryptoSwift', '~> 1.4.0'
pod 'DPOTPView'
target 'Tests' do
inherit! :search_paths
# Pods for testing
end
target 'UITests' do
# Pods for testing
end
end
原来是这个pod引起的问题:
pod 'MapboxSearch', ">= 1.0.0-beta.6", "< 2.0"
所以我把它替换成:
pod 'MapboxSearch', "1.0.0-beta.4"
(Xcode和终端运行Rosetta)