如何删除 Podfile.lock?

7

Xcode最近更新了,我的代码在STPAPIClient.m文件中出现了以下错误:

Incompatible block pointer types sending '__strong STPAPIResponseBlock _Nonnull' (aka 'void (^__strong)(__strong ResponseType, NSHTTPURLResponse *__strong, NSError *__strong)') to parameter of type 'void (^)(STPSource *__strong, NSHTTPURLResponse *__strong, NSError *__strong)'

编辑:我找到了Podfile.lock文件,但每次删除它并使用pod install命令后,我检查项目目录,发现Podfile.lock依然存在。有人知道怎么彻底删除它吗?谢谢!


2
Podfile.lock is an output of pod install - Paul Beusterien
好的。现在我正在尝试从我的podfile.lock中删除Stripe,但是当我执行pod install时,它会重新安装Stripe。我该如何删除Stripe? - Hiya
1
请参阅 https://guides.cocoapods.org/using/pod-install-vs-update.html。 - Rob
从Podfile中移除Stripe。 - Paul Beusterien
感谢Paul和Rob! - Hiya
2个回答

6

如果您已经删除了一些包,但它们仍显示在podfile.lock中。

只需在终端中前往项目/ios_directory并逐个运行以下命令:

=> pod update

=> pod install


6
“pod clean”对我没用。我运行了“pod update”,它为我生成了一个新的podfile.lock文件,然后我就能够运行“pod install”了。 - Chase Ernst

5

您不应直接修改Podfile.lock文件,因为它是由pod install命令自动生成的。如果您想移除一个库,应该编辑Podfile文件,删除需要移除的库,然后重新运行pod install命令。


如果我删除了 podfile.lock 文件,这会造成问题吗?还是正常的? - Oliver D
1
通常情况下,您不应该删除podfile.lock文件,但如果您这样做了,我相信重新运行“pod install”命令应该可以解决问题。 - Rob Napier

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接