首页 > 解决方案 > 没有这样的模块'MapboxCommon_Private'/MapboxSearch/编译器不支持这个SDK

问题描述

所以我从 GitHub 克隆了一个现有的存储库,并在我的设备上尝试了 pod(MacBook Pro M1 2020 bigSur 11.6 和 Xcode 13)Cocoapods 没有按预期工作,所以我在网上查了一下,在尝试使用 Rosetta 打开并安装 ffi gem 之后我设法安装了大部分 pod。但是,这两个错误不断出现:

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 文件出现另一个错误:

吊舱文件:

# 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

标签: iosswiftxcodecocoapods

解决方案


事实证明,这个 pod 导致了这个问题:

pod 'MapboxSearch', ">= 1.0.0-beta.6", "< 2.0"

所以我将其替换为:

pod 'MapboxSearch', "1.0.0-beta.4"

(使用 Rosetta 运行的 Xcode 和终端)


推荐阅读