最近我一直在做兩個 iOS 專案。其中一個source在 Podfile 中有命令,另一個沒有。后者的 Podfile 看起來像這樣:
platform :ios, '12.0'
target 'MyApp' do
use_frameworks!
pod 'Foo', '~> 1.2'
pod 'Bar', '~> 5.4'
# ...etc
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
end
end
end
每當我pod install為該專案運行時,我都會收到有關未使用的主規范 repo 的警告,但它說要添加warn_for_unused_master_specs_repo => false以禁用警告。所以我這樣做:
platform :ios, '12.0'
warn_for_unused_master_specs_repo => false # this is new
# ...
現在,當我嘗試pod install. 我不了解 Ruby,所以我自己不能很好地診斷問題。
運行 pod install 時,我已經發現“您的專案沒有明確指定 CocoaPods 主規范 repo”警告。接受的答案說要洗掉主規格回購,這在我的情況下不是一個可行的解決方案 - 就像我在開始時所說的那樣,我正在研究另一個指定的專案source,每當我在pod install那里運行時,警告就會出現背部。
我還發現:warn_for_unused_master_specs_repo(帶有冒號)是install!命令的一個選項,它可能看起來像這樣:
install! 'cocoapods', :warn_for_unused_master_specs_repo => false
但我目前沒有install!命令,我不確定添加一個命令會產生什么后果。(谷歌在這里沒有幫助,因為結果更多的是關于pod installshell 命令而不是install!Ruby 命令。)
為什么警告會提示一些不允許的內容,我應該怎么做?
uj5u.com熱心網友回復:
采用install! 'cocoapods', :warn_for_unused_master_specs_repo => false
install! 'cocoapods'任何 Podfile 都隱含一個空命令。Podfile 指南中的更多資訊。
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/427592.html
