ios - 没有这样的模块'MapboxCommon_Private'/MapboxSearch/编译器不支持这个SDK
问题描述
所以我从 GitHub 克隆了一个现有的存储库,并在我的设备上尝试了 pod(MacBook Pro M1 2020 bigSur 11.6 和 Xcode 13)Cocoapods 没有按预期工作,所以我在网上查了一下,在尝试使用 Rosetta 打开并安装 ffi gem 之后我设法安装了大部分 pod。但是,这两个错误不断出现:
- 没有这样的模块'MapboxCommon_Private'
- 构建模块“MapboxSearch”失败;编译器不支持此 SDK(该 SDK 使用“Apple Swift 版本 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)”构建,而此编译器为“Apple Swift 版本 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 编译器中的错误
吊舱文件:
# 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"
(使用 Rosetta 运行的 Xcode 和终端)
推荐阅读
- c++11 - 对于隐式声明的移动赋值运算符,用户声明是什么意思?
- android - 将 Firebase Persistence Enabled 设置为 true 后未检索新数据?
- python - 对列表中的 Q 对象查询应用 OR 逻辑
- ios - 如何找到可自动增长的 UILabel 的实际高度
- c# - 在 Window 10 机器中加载 Sqlite dll 时出错
- linux - 我需要刷新命名管道吗?
- merge - 在 SAS 中,如何通过某个 ID 将多行连接为 1
- java - 从服务器接收消息
- ios - UILabel 在 UIStackView 中提前中断
- deprecated - JSF 2.3、CDI 2.0 | com.sun.faces.flow.FlowDiscoveryCDIHelper 类已从 CDI 1.1 中弃用