找不到Alamofire框架(Xcode-8.2.1和iOS 10.2) [英] Alamofire framework not found(Xcode-8.2.1 and iOS 10.2)

查看:159
本文介绍了找不到Alamofire框架(Xcode-8.2.1和iOS 10.2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试了很多解决方案,但最终却无所适从。我刚刚为Alamofire和swiftyJson 安装了可可豆荚。现在,当我清理并构建我的项目时,我得到了一个错误

I have tried so many solutions out there but finally not getting what to do . I just installed cocoa pods for Alamofire and swiftyJson . And now when i clean and build my project i get an error


没有这样的框架ALAMOFIRE

NO SUCH FRAMEWORK ALAMOFIRE

当我尝试在任何快速文件中导入Alamofire时,它说:

when I try import Alamofire in any swift file it says:


没有这样的模块ALAMOFIRE

NO SUCH MODULE ALAMOFIRE

我更新的Podfile是这样的(没有这样的框架Alamofire 错误由此pod文件解决)。但是仍然没有得到这样的 Alamofire模块-:

My Updated Podfile is something like this( No such framework Alamofire error is solved by this pod file). But still getting No such Module alamofire-:

  # Uncomment the next line to define a global platform for your project
platform :ios, ’10.2’


source 'https://github.com/CocoaPods/Specs.git'

target 'ModesTests' do
use_frameworks!
 pod 'Alamofire', '~> 4.4'

  target 'ModesUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

这就是我创建 Modes.xcworkspace 并安装 pods并创建pod文件--

This is how I created Modes.xcworkspace and installed pods and created pod file -:

1 )打开终端

2)使用cd命令导航到包含ModesSample项目的目录:

2) Navigate to the directory containing your ModesSample project by using the cd command:

3 )发出init命令

3) Give the init command

pod init

4)使用以下命令打开Podfile ::

4)Open the Podfile using command-:

open -a Xcode Podfile

创建的pod文件显示在最后一步的上方是-:

Created pod file is shown above last step is-:

5) pod install

所有我已验证-:

1)我在路径-:模式->常规->链接框架和库下添加了Alamofire.framework

1) I have added Alamofire.framework under path -: Modes->General->Linked Frameworks and Libraries

2)尝试在以下位置添加Alamofire目录路径:构建设置->框架搜索路径

2) Tried adding Alamofire directory path under-: Build settings->Framework search paths

3)经过验证的构建活动体系结构仅将其值视为-:

3) Verified Build Active Architecture Only values it is-:

DEBUG:YES
RELEASE:NO

有人可以帮我解决这个问题,我已经尝试了3次。谢谢

Can anyone please help me solve this, I have tried 3 times now. Thanks

推荐答案

这是我对 ios-10.2和Xcode-:8.2.1 所做的全部工作(效果很好)

This is what I completely did for ios-10.2 and Xcode -:8.2.1 (This works great)

1)创建一个项目。

2)转到终端

3)给出命令 cd桌面(如果项目在桌面上)

3) give command cd desktop(if project on desktop)

4) cd项目名称

5) pod初始化(此在目录中创建的pod文件)

5) pod init(This created pod file in directory)

6)使用此pod fie-:

# Uncomment the next line to define a global platform for your project
platform :ios, '10.2'
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
def shared_pods
use_frameworks!
   pod 'Alamofire', '~> 4.4'
   pod 'SwiftyJSON'
end
target 'Modes' do
   # Pods for Modes
   shared_pods
end
target 'ModesTests' do
   inherit! :search_paths
   # Pods for testing
   shared_pods

 end

 target 'ModesUITests' do
   inherit! :search_paths
    # Pods for testing
    shared_pods

   end




MARK-:我在 shared_pods 函数下添加了 use_frameworks (这使我可以使用框架)不要

MARK-: I added use_frameworks under function shared_pods ( That allowed me to use frameworks) don't put it outside it.

7)保存pod文件

8 ) pod安装

9)关闭终端和所有打开的项目。

9) Close Terminal and all open projects .

10)转到项目目录并打开 Projectname.xcworkspace。

10) Go to project directory and open Projectname.xcworkspace.

11)首先清理并构建

11) First Clean and Build.

12)导入Alamofire

12) import Alamofire

13)Bravo使用您的框架。

13) Bravo use your frameworks.

这篇关于找不到Alamofire框架(Xcode-8.2.1和iOS 10.2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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