git 找不到 Alamofire 框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26335453/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Alamofire framework not found
提问by Joffrey Outtier
I am trying to install alamofire into my project so I can upload images to my server, however I cannot seem to find the alamofire.framework
file. I have downloaded the git twice, done the installation instructions on https://github.com/Alamofire/Alamofire
but when it comes to step 6
, how and where do I get the alamofire.framework
file?
我正在尝试将 alamofire 安装到我的项目中,以便我可以将图像上传到我的服务器,但是我似乎找不到该alamofire.framework
文件。我已经下载了两次 git,完成了安装说明,https://github.com/Alamofire/Alamofire
但是当涉及到git时step 6
,我如何以及从哪里获取alamofire.framework
文件?
I am new to this, so sorry if it is a stupid question.
我是新手,很抱歉,如果这是一个愚蠢的问题。
回答by harishannam
You have to open yourprojectname.xcworkspace
你必须打开 yourprojectname.xcworkspace
You might get this error if you are opening your .xcworkproj instead of workspace
如果您打开 .xcworkproj 而不是工作区,您可能会收到此错误
回答by Joffrey Outtier
- Close your Xcode project
- Re-Open your project with the Xcode workspace file and not with the .xcodeproj
- 关闭您的 Xcode 项目
- 使用 Xcode 工作区文件而不是 .xcodeproj 重新打开您的项目
This work fine for me !
这对我来说很好用!
回答by Helbert
You just need to change Framework Search Paths
to $(inherited)
.
您只需要更改Framework Search Paths
为$(inherited)
.
P.S: Build Settings -> Search Paths -> Framework Search Paths
PS:构建设置 -> 搜索路径 -> 框架搜索路径
回答by Nanda Z
I solve my problem with this way (Only if your case are you have imported Alamofire in project but still not found)
我用这种方式解决了我的问题(仅当您在项目中导入了 Alamofire 但仍未找到时)
回答by Suraj Sonawane
Use Cocoapodsto integrate Alamofirein your project:
使用Cocoapods将Alamofire集成到您的项目中:
To add Alamofire into your project please do the following steps:
要将 Alamofire 添加到您的项目中,请执行以下步骤:
add the below lines into your pod file.
将以下行添加到您的pod 文件中。
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 2.0'
回答by Tim O'Brien
Not stupid!
不傻!
- Click the little (easily missed) + button in the bar under General, Build Phases, etc. and in the dropdown click New Copy Files Phase
- Double click the title and rename it "Copy Frameworks" (optional)
- Change destination to Frameworks
- Add Alamofire.framework
- 单击 General、Build Phases 等下栏中的小(容易错过)+ 按钮,然后在下拉列表中单击New Copy Files Phase
- 双击标题并将其重命名为“Copy Frameworks”(可选)
- 将目标更改为框架
- 添加 Alamofire.framework
Once it's linked it doesn't necessarily exist on your device, this ensures it will.
链接后,它不一定存在于您的设备上,这确保它会存在。
回答by user964502
I was also facing the same issue, and '$(inherited)' was missing in Target -> Build Settings ->Framework Search paths. Giving this fixed my issue.
我也遇到了同样的问题,目标 -> 构建设置 -> 框架搜索路径中缺少 '$(inherited)'。给这个解决了我的问题。
回答by Amir Ardalan
I removed the Alamofire
from pod file but I got the error again finally I figured out Alamofire
exist in Target -> Build setting -> Other Linker Flags
and remove from there and build successfully finally.
我Alamofire
从 pod 文件中删除了该文件,但我再次遇到错误,最后我发现Alamofire
存在Target -> Build setting -> Other Linker Flags
并从那里删除并最终成功构建。