当我尝试构建项目时,出现编译时错误,提示找不到我的pod的“模块映射文件”,并且缺少“ SwiftShimes”模块。
这很奇怪,因为我所有的模块映射文件都在我安装Pod时应该放置的位置。
我正在使用Xcode 10.2和Cocoapods 1.6.1。
我尝试了以下->
这是我遇到的错误类型->
Module map file '/Users/kaunamohammed/Library/Developer/Xcode/DerivedData/OutNow-gxdxvzwmnijmrlajtbtyclkhrgqs/Build/Products/Debug-iphoneos/CodableFirebase/CodableFirebase.modulemap' not found
我希望我的项目能够正确构建,但事实并非如此,我不确定还有其他事情要做。
这是我的Podfile的样子
platform :ios, '10.0'
workspace 'OutNow'
target 'OutNow' do
use_modular_headers!
#Pods for OutNow
pod 'Instabug'
pod 'SwiftMessages'
pod 'CodableFirebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Firestore'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'MarqueeLabel/Swift'
pod 'RxSwift', '4.4.2'
pod 'RxCocoa', '4.4.2'
pod 'Kingfisher', '5.3.1'
pod 'InstantSearchClient', '6.0'
pod 'CoordinatorLibrary', '1.0.5'
pod 'UIScrollView-InfiniteScroll', '1.1.0'
target 'OutNowTests' do
inherit! :search_paths
# Pods for testing
end
end
答案 0 :(得分:46)
万一它对其他人有帮助,我可以用其他方式解决此问题。我不小心打开了.xcproject
而不是.xcworkspace
。当我打开正确的文件时,错误消失了。
答案 1 :(得分:4)
仅当我想进行存档时才遇到此问题。另一方面,调试效果很好。一段时间后,我注意到目标,项目和Podfile最低iOS版本之间的最低iOS版本有所不同。在将它们全部同步为相同值(iOS 11)后, Xcode为我提供了“验证项目设置-更新为推荐设置” 选项,该选项已被我接受,并且能够存档我的项目。
答案 2 :(得分:2)
我自己解决了这个问题。我可以告诉你我做了什么。不确定到底是哪个步骤完成的,但是下面是所有步骤:
pod cache clean --all
pod init
。新的“ Podfile”文件已添加到目录中pod install
就我而言,我认为“ Podfile”中的行use_frameworks!
起到了作用。
希望这对你们有帮助!
答案 3 :(得分:0)
我也有这个问题,我对XCode不太熟悉,但是我打开了.xcodeworkspace文件,然后单击build,成功了!
答案 4 :(得分:0)
我通过删除OTHER_SWIFT_FLAGS
中的Swift Compiler - Custom Flags
自定义标志来解决此问题
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -Xcc -fmodule-map-file=\"${PODS_ROOT}/modulePath/moduleName.modulemap\"";
答案 5 :(得分:0)
我遇到了同样的问题,但 Fastlane 使用了健身房 build_app
。
如 Josip B 所述,我确保在我的目标、项目和 Podfile 之间同步了最低 iOS 版本。这允许我使用 XCode 归档我的应用程序,但它仍然无法使用 Fastlane。
经过大量搜索后,通过使用此 Podfile 安装后脚本确保每个已安装 Pod 的 IPHONEOS_DEPLOYMENT_TARGET
版本都继承了我的 Podfile
版本,它能够解决我的问题:>
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end