簡體   English   中英

Xcode 13.3 beta 3: "swift package init" shows warning: "~/Library/org.swift.swiftpm/collections.json has been deprecated" but dunno how to use new one

[英]Xcode 13.3 beta 3: "swift package init" shows warning: "~/Library/org.swift.swiftpm/collections.json has been deprecated" but dunno how to use new one

Just upgraded to Xcode 13.3 beta 3 (from Xcode 13.2.1) and ran swift package init . 它產生了一個棄用警告,我以前沒有見過這個:

warning: Usage of /Users/sajjon/Library/org.swift.swiftpm/collections.json has been deprecated. Please delete it and use the new /Users/sajjon/Library/org.swift.swiftpm/configuration/collections.json instead.

但我不知道如何“使用新的......代替”? 事實上,我什至不知道org.swift.swiftpm/collections.json是如何或何時創建的。

該怎么辦?

完整打印:

~/Developer/DeleteMe ⌚ 13:57:37
$ swift package init
2022-02-25 13:57:42.211 xcodebuild[54679:13318505] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-02-25 13:57:42.212 xcodebuild[54679:13318505] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-02-25 13:57:43.052 xcodebuild[54754:13318823] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2022-02-25 13:57:43.053 xcodebuild[54754:13318823] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
warning: Usage of /Users/sajjon/Library/org.swift.swiftpm/collections.json has been deprecated. Please delete it and use the new /Users/sajjon/Library/org.swift.swiftpm/configuration/collections.json instead.
Creating library package: DeleteMe

警告說您需要刪除該文件。

Please delete it and use the new /Users/sajjon/Library/org.swift.swiftpm/configuration/collections.json instead.

所以請刪除它,它會有所幫助。

根據@jalone 的評論,這可能會導致 Xcode 在打開項目時崩潰。 在我的情況下它沒有這樣做,但我所擁有的只是通用的 Apple collections: https://developer.apple.com/swift/packages/collections/apple.json

謹慎行事

看起來我需要做的就是運行它來消除警告。

rm ~/.swiftpm/config/collections.json

應該有一個額外的collections.json位於~/.swiftpm/config/configuration/collections.json是您使用時現在存儲包的位置

swift package-collection add <package.json>

有關更多信息,請參閱此處的 SE 提案文檔

我在 Xcode 14 RC 中看到了這個警告,並且能夠通過刪除和重新添加我的一個包來解決它(在項目 > Package 依賴項下)。

go to the path and open org.swift.swiftpm file, it will be open into IDE then remove collection.json that is available outside of the configuration folder. 警告將得到解決。

安裝 Xcode 14.0 后,我遇到了這個問題。 This works for me: Go to directory and delete the entire file NOT only collection but the whole file "org.swift.swiftpm" and if it's there "org.swift.swiftpm.lock" and MAKE sure the anything related to SPM is not運行包括 Xcode 所以在你刪除它們之前關閉它們

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM