热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

xcode7.3,一开始用Cocoapods最新版本1.2.0引入Alamofire编译是完全通过编译和运行的,指定了版本podAlamofire,3.5后来增删pods文件里的列表,有时

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
add a comment

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


推荐阅读
author-avatar
张兵在江湖
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有