【问题标题】:Remove only a library from cocoapod project, how i can do?从 cocoapod 项目中只删除一个库,我该怎么办?
【发布时间】:2016-06-21 08:20:20
【问题描述】:

我有一个应用程序,其中包含两个安装了 cocoapods、Braintree 和 GoogleAnalytics 的库。我想做的是从我的项目中删除 Braintree。这是我项目根目录中的 Podfile:

    # Uncomment this line to define a global platform for your project
    # platform :ios, '7.0'

    target 'MyApp' do

    pod 'Braintree'
    pod 'Google/Analytics'

    end

     target 'MyAppTests' do

      pod 'Braintree'

   end

我试过这个solution,但也许我做错了什么。我的步骤是:打开终端 -> 进入我的项目的根目录 -> $ pod update。这将返回给我“找不到 pod 更新命令”。有什么问题或删除 Braintree 库的正确步骤是什么?

【问题讨论】:

    标签: ios cocoapods braintree


    【解决方案1】:

    按以下方式更新您的 pod 文件

        # Uncomment this line to define a global platform for your project
        # platform :ios, '7.0'
    
        target 'MyApp' do
    
        #pod 'Braintree'
        pod 'Google/Analytics'
    
        end
    
         target 'MyAppTests' do
    
          #pod 'Braintree'
    
       end
    

    在文件上方,我评论了 Braintree 库。现在您需要执行pod updatepod install

    当您遇到“找不到 pod 更新命令”的错误时,您应该首先按照https://stackoverflow.com/a/37939140/1030951 答案中的指导在您的 Mac 中安装 cocoapods。

    【讨论】:

      【解决方案2】:

      尝试运行此命令

      sudo gem intall cocoa pods
      

      然后再次尝试更新 pod

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-05-29
        • 2020-09-28
        • 1970-01-01
        • 2021-10-15
        相关资源
        最近更新 更多