无法将Alamofire添加到Swift项目 [英] Cannot add Alamofire to Swift Project

查看:80
本文介绍了无法将Alamofire添加到Swift项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从此处使用非指令将alamofire添加到快速项目中



完成所有这些步骤,清理项目很多计时器,然后重新启动XCode,没有任何帮助。错误不会消失



http:/ /i.stack.imgur.com/kNU3R.png



无法为'Alamofire'加载基础模块

我所做的更改:



1)将项目文件添加到我的项目中



i.stack.imgur.com/eUe8E.png



2)添加到构建阶段面板



i.stack.imgur.com/1wanl.png



3)添加到常规标签



i.stack .imgur.com / L3TTR.png



这有什么问题?

解决方案

我遇到了同样的问题。我可以通过执行以下操作来修复它。


  1. 下载Alamofire源文件夹。
    https://github.com/Alamofire/Alamofire/tree/master/Source


  2. 将其拖动到您的xCode项目中,然后单击如果需要,复制项目。如果您在Finder中查看项目,则Alamofire Source文件夹应位于项目本身中。 (例如:我有3个项目。示例应用程序,示例应用程序.xcodeproj,示例应用程序测试。文件夹应位于示例应用程序中。)


  3. 最后,您需要被完成!但是,现在,您不需要导入Alamofire,因为您实际上并没有加载框架。
    例如,您现在不用上载Alamofire.upload。



Trying to add alamofire to swift project using unstruction from here

Did all these steps, clean project a lot of timer and restarted XCode, nothing helps. Error does not dissappear

http://i.stack.imgur.com/kNU3R.png

"Cannot load underlying module for 'Alamofire'" and nothing to do

Changes I did:

1) added project file to my project

i.stack.imgur.com/eUe8E.png

2) added to build phases panel

i.stack.imgur.com/1wanl.png

3) added to general tab

i.stack.imgur.com/L3TTR.png

What`s wrong with that?

解决方案

I had the same problem. I was able to fix it by doing the following.

  1. Download the Alamofire "Source" folder. https://github.com/Alamofire/Alamofire/tree/master/Source

  2. Drag it into your xCode Project, and click "Copy Items if Needed". If you view the project in Finder, the Alamofire Source folder should be in the project itself. (Ex: I have 3 items. Example App, Example App.xcodeproj, Example App Tests. The folder should be in Example App.)

  3. Finally, you should be done! However, now, you do not need to import Alamofire, since you are not actually loading a framework. For example, instead of doing Alamofire.upload, you will now only do upload.

这篇关于无法将Alamofire添加到Swift项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆