“没有这样的模块‘Alamofire’"Xcode 无法识别 Alamofire 框架

编程入门 行业动态 更新时间:2024-10-27 12:26:41
本文介绍了“没有这样的模块‘Alamofire’"Xcode 无法识别 Alamofire 框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我意识到在其他问题中也出现了同样的错误(例如

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

解决方案

做以下事情,你就可以从Pods"中导入任何 swift 文件

1) 清理你的项目

2) 确保您的所有Pod">构建设置">构建活动仅架构"设置为否".

3) 不要运行,只需构建您的项目.

4) 现在,将Pods"中的任何文件导入任何 swift 文件

例如:导入 Alamofire

5) 再次构建项目,它将按预期工作.最后,你可以访问它的属性

更新:

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

希望这有帮助!

I realize that the same error was asked in other questions (like here), but their solutions are not working for me. I keep getting a build failure in my app: "No such module 'Alamofire'". I followed the cocoadocs installation instructions (here) for installing Alamofire and it still is not working. I made sure everything has the same deployment target. Embedded Binaries and Frameworks

Here's my podfile text.

source 'github/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

Also, I tried "$ pod install" again in Terminal and got this message:

[!] 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.

After following Sohil's suggestions, XCode now recognizes the Alamofire module, but 22 new issues have arisen.

Update #2: So I'm now on Xcode 7.3 and Swift 2.2, but I'm receiving a new error with the workspace Link: "ld: framework not found Alamofire. clang: error: linker command failed with exit code 1 (use -v to see invocation)."

解决方案

Do the following things and you can import any swift file from "Pods"

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

Update:

For the updated question, I hope you are using Xcode 7.3 so please update the Alamofire to Swift 2.2

Hope this helps!

更多推荐

“没有这样的模块‘Alamofire’"Xcode 无法识别 Alamofire 框架

本文发布于:2023-11-26 03:39:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632487.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:框架   模块   无法识别   quot   Alamofire

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!