Cannot add Alamofire to Swift Project

时光毁灭记忆、已成空白 提交于 2019-12-17 19:56:30

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/31706589/cannot-add-alamofire-to-swift-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!