【问题标题】:Pod install displaying error in cocoapods version 1.0.0.beta.1Pod 安装在 cocoapods 版本 1.0.0.beta.1 中显示错误
【发布时间】:2016-04-06 01:11:02
【问题描述】:

我的 podfile 正在工作,但在更新到 cocoapods 版本 1.0.0.beta.1 之后

pod install 显示以下错误

MacBook-Pro:iOS-TuneIn home$ pod install
Fully deintegrating due to major version update
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
Deleted 1 'Embed Pods Frameworks' build phases.
- libPods.a
- Pods.debug.xcconfig
- Pods.release.xcconfig
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
Deleted 1 'Copy Pods Resources' build phases.
Deleted 1 'Check Pods Manifest.lock' build phases.
- libPods.a
- libPods.a
Deleted 1 empty `Pods` groups from project.
Removing `Pods` directory.

Project has been deintegrated. No traces of CocoaPods left in project.
Note: The workspace referencing the Pods project still remains.
Updating local specs repositories
Analyzing dependencies
[!] The dependency `AFNetworking (= 2.6.3)` is not used in any concrete target.
The dependency `MBProgressHUD (~> 0.9.1)` is not used in any concrete target.
The dependency `PDKeychainBindingsController (~> 0.0.1)` is not used in any concrete target.
The dependency `FMDB/SQLCipher` is not used in any concrete target.
The dependency `ZXingObjC (~> 3.1.0)` is not used in any concrete target.
The dependency `SDWebImage (~> 3.7.2)` is not used in any concrete target.
The dependency `SignalR-ObjC (~> 2.0.0.beta3)` is not used in any concrete target.
The dependency `CJPAdController (from `https://github.com/nabeelarif100/CJPAdController.git`)` is not used in any concrete target.
The dependency `ECSlidingViewController (~> 2.0.3)` is not used in any concrete target.
The dependency `VGParallaxHeader` is not used in any concrete target.
The dependency `EMString` is not used in any concrete target.
The dependency `Google/SignIn` is not used in any concrete target.
The dependency `VIPhotoView (~> 0.1)` is not used in any concrete target.
The dependency `EncryptedCoreData (from `https://github.com/project-imas/encrypted-core-data.git`)` is not used in any concrete target.
MacBook-Pro:iOS-TuneIn home$ 

Pod 文件:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking', '2.6.3'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'PDKeychainBindingsController', '~> 0.0.1'
pod 'FMDB/SQLCipher'
pod 'ZXingObjC', '~> 3.1.0'
pod 'SDWebImage', '~>3.7.2'
pod 'SignalR-ObjC','~>2.0.0.beta3'
pod 'CJPAdController', :git => 'https://github.com/nabeelarif100/CJPAdController.git'
pod 'ECSlidingViewController', '~> 2.0.3'
pod 'VGParallaxHeader'
pod 'EMString'
pod 'Google/SignIn'
pod 'VIPhotoView', '~> 0.1'
pod 'EncryptedCoreData', :git => 'https://github.com/project-imas/encrypted-core-data.git'

【问题讨论】:

    标签: ios cocoapods


    【解决方案1】:
    platform :ios, '8.0'
    target 'YourTargetName' do
    
      ALL PODS HERE
    
    end
    

    打开终端,进入项目文件夹并输入代码

    pod update
    

    【讨论】:

      【解决方案2】:

      Pod 文件只是一个 ruby​​ 文件,您需要为所有目标指定所需的 pod。 一种可用的解决方案是在 shared_pos 中定义所有必需的 pod,并将其用于每个目标。

      例如:

      Podfile

      platform :ios, '9.0'
      
      use_frameworks!
      
      def Shared_Pods
          pod 'Quick', '0.5.0'
          pod 'Nimble', '2.0.0-rc.1'
      end
      
      target 'MyMainTarget' do
          Shared_Pods
      end
      
      target 'MyUITests' do
          Shared_Pods
      end
      

      【讨论】:

        【解决方案3】:

        我是在podfile中进行这个操作的:

        来源'https://github.com/CocoaPods/Specs.git'

        平台:ios,'8.0'

        目标“目标项目名称”做

        pod "AFNetworking"

        结束

        【讨论】:

        • 这是准确的答案。谢谢朋友
        【解决方案4】:

        适用于新版 cocoapods i.i 1.0.1

        pod 'SlideMenuControllerSwift' 吊舱“SDWebImage” pod 'SearchTextField'

        我遇到了错误:

        依赖SlideMenuControllerSwift 未在任何具体目标中使用。 依赖关系SDWebImage 未在任何具体目标中使用。 依赖SearchTextField 未在任何具体目标中使用。

        比我改成

        以“YOUR_PROJECT_NAME”为目标

         pod "YOUR_POD"
        

        结束

        比它有效

        【讨论】:

          【解决方案5】:

          1) 在 Xcode 而不是 TextEdit 或任何其他编辑器中添加和打开 Podfile。 (查看 pod 文件时突出显示语法将简化查找语法错误的过程

          2) 在您的 Podfile

          中添加项目依赖项,如下所示
          def pods
            pod 'AFNetworking', '~> 2.6'
            pod 'ORStackView', '~> 3.0'
            pod 'SwiftyJSON', '~> 2.3'
          end
          

          3) 在项目目标中添加上述定义pods如下

          target 'App_Target_Name' do
            pods
          end
          

          【讨论】:

            【解决方案6】:

            您必须在您的 pod 周围添加 target 'your target' doend,如下所示。

            target 'your target' do
            pod 'AFNetworking', '2.6.3'
            pod 'MBProgressHUD', '~> 0.9.1'
            pod 'PDKeychainBindingsController', '~> 0.0.1'
            end
            

            另外:您可能需要删除 pods 目录、Podfile.lock 和 xcworkspace 文件,再次运行 pod install

            【讨论】:

            • 我还需要删除 Podfile.lock 和其他文件。当我刚刚添加目标“你的目标”并结束时,安装成功但没有更新文件版本 - 只是重新安装了以前的版本。删除 Podfile.lock 等文件后,安装了最新的文件。
            【解决方案7】:

            我也有同样的问题,连我都改成

            目标“TargetName”做 pod 'Alamofire', '~> 3.1.4' pod 'SwiftyJSON', '~> 2.3.2' 结束

            好像缓存有问题,它总是读取旧版本的 PodFile,即使我删除了 PodFile,同样的错误出现。这很奇怪。

            但是,当我打开一个新终端,运行 pod install 时,它可以工作。

            【讨论】:

              【解决方案8】:

              在对 cocoapods 进行新的更改后,您必须将以下行添加到您的 podfile 中。

              target "YOUR_PROJECT_NAME" do
              
                   pod "YOUR_POD"
              
              end
              

              【讨论】:

              • 你应该得到更多的选票@Karthik。任何人都没有提到这里的“目标”是什么意思
              • 谢谢@JanakaRRajapaksha
              【解决方案9】:

              来自 CocoaPods 网站:

              CocoaPods 提供了一个pod init 命令来创建一个具有智能默认值的 Podfile。你应该使用它。

              【讨论】:

              • 它不会添加target 'name' do end
              【解决方案10】:

              我的 podfile 格式正确,所以答案对我不起作用。我不得不做的是以下所有事情: 首先,

              1. gem 卸载 cocoapods
              2. rvm 获得稳定 --auto-dotfiles
              3. rvm 使用 ruby​​-2.1.2
              4. rvm osx-ssl-certs 全部更新
              5. rvm ruby​​gems 最新
              6. sudo gem 来源 -r https://rubygems.org/
              7. sudo gem 来源 -a http://rubygems.org/
              8. gem install cocoapods -v 1.0.0.beta.1 --pre -V

              我遇到了 SSL 错误、超时错误和路径错误。这解决了所有这些问题。我添加这个答案是希望它对某人有所帮助 - 大多数有这个问题的人不需要完成所有这些步骤,如果没有必要也不应该这样做。请记住,这会将 d/l 链接更改为不使用 https,因此请务必在解决此问题后将其更改回来。 Thisthisthis Stack Overflow 问题帮助我最终解决了这些问题。

              【讨论】:

                【解决方案11】:

                您必须为每个 pod 指定一个目标。

                例如如果之前你的 Podfile 是这样写的:

                pod 'Alamofire', '~> 3.1.4'
                pod 'SwiftyJSON', '~> 2.3.2'
                

                改成

                target "TargetName" do
                    pod 'Alamofire', '~> 3.1.4'
                    pod 'SwiftyJSON', '~> 2.3.2'
                end
                

                【讨论】:

                • 那行得通。要将相同的 pod 添加到多个目标,请参阅 natashatherobot.com/…
                • 是工作区名称的目标吗?例如。 "TargetName"
                • 目标是目标名称:)
                • 谢谢它现在可以工作了,但奇怪的是(在我早期的 Xcode 项目中不需要指定目标)!
                【解决方案12】:

                我今天遇到了同样的问题。为了缓解,我卸载了 cocoapod,然后再次安装 0.39 版。

                这里是如何卸载的链接:https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine

                这个答案不能解决根本原因,但可以让你畅通无阻。我没有足够的声望离开cmets,所以我在这里放了一个答案来解封你。

                【讨论】:

                • 一个很好的参考,但你也应该提到这些步骤,以防有一天参考被删除。
                猜你喜欢
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 2017-02-23
                • 2019-09-28
                • 1970-01-01
                • 2021-11-26
                相关资源
                最近更新 更多