Cocoapods最新版本1.2.0引入Alamofire编译有时出错的解决办法

来源:互联网 发布:创业公司 程序员 编辑:程序博客网 时间:2024/06/06 14:08

xcode7.3,

一开始用Cocoapods最新版本1.2.0引入Alamofire编译是完全通过编译和运行的,

指定了版本 pod 'Alamofire','3.5'

后来增删pods文件里的列表,有时就编译不同过了,都是Alamofire的错误,400多个,

从svn上回复回去又是可以编译通过的哦,

执行了pod update或pod install就出现了400多个错误,


找了半天,看链接:具体内容看文章末尾: 

Alamofire 4.0, Swift 3 AFError.Swift

在终端执行这句解决问题: pod deintegrate && pod _1.1.1_ install

果然stackoverflow上什么都有



文章内容:


2
down votefavorite

Background:

I am relatively new to programming and am updating my current iOS project which uses Alamofire & Swift 3. The project was working fine until I updated to Alamofire ~4.0 which presented me with 530 errors.

I'm opening up the xcworkspaceproject in Xcode8.1

I tried clearing up the problem using the suggestions in this StackOverflow Thread: Alamofire XCode8 Swift 3 results in 786 Compile Errors

including:

gem install cocoapods --pre

and also downgrading the cocoapod version cocoapods-1.2.0.beta.1 from the current beta version down to cocoapods-1.1.1

I also: 1. Deleted the podfile 2. created a new podfile 3. reinstalled all the pods 4.) Clean & Build

Unfortunately none of these worked.

Displayed Errors:

Type 'AFError' does not conform to protocol 'RawRepresentable'

Most of the other of the 530 errors are:

Definition conflicts with previous value

enter image description here

All the errors are contained within the AFError.Swift file (which is locked by default). Thanks for any solution to help in fixing this.

shareimprove this question
 
1 
If the error is use of undeclared type Error, it means your project is still in 2.x version – Rajan MaheshwariDec 6 at 4:23

1 Answer

activeoldestvotes
up vote1down vote

a. Try installing your pods using a stable version after a deintegration:

`pod deintegrate && pod _1.1.1_ install`

b. Try purging DerivedData cache: close Xcode (fully close, like with cmd+q), delete the DerivedData folder, empty the trash. And only re-open Xcode after that last step, to correctly re-build the cache.

shareimprove this answer
 
 
Thanks for the help. This was able to get it working. I did have to delete the podfile from the project also but now it is fixed :) – RH Blanchfield Dec 9 at 13:31

0 0
原创粉丝点击