我有一个应用程序,其中包含两个安装了 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 库的正确步骤是什么?
最佳答案
按照以下方式更新你的 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 update
或 pod install
。
当您遇到“找不到 pod 更新命令”的错误时,您应该首先按照 https://stackoverflow.com/a/37939140/1030951 中的指导在您的 mac 中安装 cocoapods。回答。
关于ios - 从 cocoapod 项目中只删除一个库,我该怎么做?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37939094/