无法将Alamofire添加到Swift项目

编程入门 行业动态 更新时间:2024-10-25 13:22:39
本文介绍了无法将Alamofire添加到Swift项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

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

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

我所做的更改:

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

i.stack.imgur/eUe8E.png

2)添加到构建阶段面板

i.stack.imgur/1wanl.png

3)添加到常规标签

i.stack .imgur / L3TTR.png

这有什么问题?

解决方案

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

  • 下载Alamofire源文件夹。 github/Alamofire/Alamofire/tree/master/Source

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

  • 最后,您需要被完成!但是,现在,您不需要导入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

    i.stack.imgur/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/eUe8E.png

    2) added to build phases panel

    i.stack.imgur/1wanl.png

    3) added to general tab

    i.stack.imgur/L3TTR.png

    What`s wrong with that?

    解决方案

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

  • Download the Alamofire "Source" folder. github/Alamofire/Alamofire/tree/master/Source

  • 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.)

  • 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项目

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

    发布评论

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

    >www.elefans.com

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