Xcode 8 Pod 更新问题 - 由于主要版本更新而重新创建 CocoaPods

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37851132/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:55:01  来源:igfitidea点击:

Xcode 8 Pod update issue - Re-creating CocoaPods due to major version update

iosxcodeswiftcocoapodsswift3

提问by Puvanarajan

I installed the latest version Xcode 8 beta. My Project was developed by Swift 2.0. So I convert the project to Swift 3. So I update the pod file. But When I update the pod file I am getting error.

我安装了最新版本的 Xcode 8 beta。我的项目是由 Swift 2.0 开发的。所以我将项目转换为 Swift 3。所以我更新了 pod 文件。但是当我更新 pod 文件时,出现错误。

Pod file:

豆荚文件:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'Alamofire', '~> 3.4'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
pod "SwiftSpinner"
#pod "AFNetworking", "2.5.0"
pod 'HanekeSwift'

Error message:

错误信息:

Re-creating CocoaPods due to major version update. Analyzing dependencies [!] The dependency Alamofire (~> 3.4)is not used in any concrete target. The dependency SwiftyJSON (from https://github.com/SwiftyJSON/SwiftyJSON.git)is not used in any concrete target. The dependency SwiftSpinneris not used in any concrete target. The dependency HanekeSwiftis not used in any concrete target.

由于主要版本更新,重新创建 CocoaPods。分析依赖关系 [!] 该依赖关系Alamofire (~> 3.4)未在任何具体目标中使用。依赖SwiftyJSON (from https://github.com/SwiftyJSON/SwiftyJSON.git)没有在任何具体目标中使用。该依赖项SwiftSpinner未用于任何具体目标。该依赖项HanekeSwift未用于任何具体目标。

NOTE: I already update the cocoapods using this command

注意:我已经使用这个命令更新了 cocoapods

sudo gem install cocoapods

回答by Sohil R. Memon

To solve this issue delete the current pod file and create one using the terminal. Follow the below steps:

要解决此问题,请删除当前 pod 文件并使用终端创建一个。请按照以下步骤操作:

  1. Open Terminal
  2. Navigate to your Project Path
  3. Type pod initin terminal to create new pod file
  4. Open the newly created pod file and write the pod line which you want to install after target "TargetName" doand before end.
  5. Then type pod installin the terminal
  1. 打开终端
  2. 导航到您的项目路径
  3. 键入pod init在终端创造新的吊舱文件
  4. 打开新创建的 pod 文件,在 后target "TargetName" do和之前写入要安装的 pod 行end
  5. 然后pod install在终端输入

Hope this helps!

希望这可以帮助!