gpt4 book ai didi

ios - "No such module ' Alamofire '"Xcode 无法识别 Alamofire 框架

转载 作者:IT王子 更新时间:2023-10-29 05:25:08 29 4
gpt4 key购买 nike

我意识到在其他问题(如 here )中也提出了同样的错误,但他们的解决方案对我不起作用。我的应用程序一直出现构建失败:“没有这样的模块‘Alamofire’”。我按照 cocoadocs 安装说明 ( here ) 安装了 Alamofire,但它仍然无法正常工作。我确保一切都具有相同的部署目标。
Embedded Binaries and Frameworks

这是我的播客文件文本。

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘9.2’
use_frameworks!

target 'MyApp' do
pod 'Alamofire', '~> 3.0'
end

target 'MyAppTests' do

end

target 'MyAppUITests' do

end

此外,我在终端中再次尝试“$ pod install”并收到此消息:

[!] The `App [Debug]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-App/Pods-App.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

在遵循 Sohil 的建议后,XCode 现在可以识别 Alamofire 模块,但是出现了 22 个新问题。

New Errors

更新 #2:所以我现在使用的是 Xcode 7.3 和 Swift 2.2,但是我收到了工作区链接的新错误:“ld: framework not found Alamofire.clang: error: linker command failed with exit code 1(使用 -v 查看调用)。”

最佳答案

执行以下操作,您可以从“Pods”导入任何 swift 文件

1) Clean your project

2) Make sure that all your "Pods" > "Build Settings" > "Build Active Architecture Only" is set to "NO".

3) Don't run, just build your project.

4) Now, import any file from "Pods" to any swift file

E.g.: import Alamofire

5) Again, build project and it will work as expected. Finally, you can access it properties

更新:

对于更新的问题,我希望你使用的是 Xcode 7.3,所以请将 Alamofire 更新为 Swift 2.2

希望这对您有所帮助!

关于ios - "No such module ' Alamofire '"Xcode 无法识别 Alamofire 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36417151/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com