Xcode 13.3 beta 3:“swift package init”显示警告:“~/Library/org.swift.swiftpm/collections.json 已被弃用”但不知道如何使用新的

发布于 2025-01-09 20:14:22 字数 1973 浏览 1 评论 0原文

刚刚升级到 Xcode 13.3 beta 3(从 Xcode 13.2.1)并运行 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

Just upgraded to Xcode 13.3 beta 3 (from Xcode 13.2.1) and ran swift package init. It generated a deprecation warning, I have not seen this before:

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.

But I do not know HOW to "use the new ... instead"? In fact I don't even know how or when org.swift.swiftpm/collections.json was created.

What to do?

Full print:

~/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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

风渺 2025-01-16 20:14:22

我安装 Xcode 14.0 后遇到了这个问题。
删除 org.swift.swiftpm 对我有用:

  1. 确保与 SPM 相关的任何内容都没有运行,包括 Xcode。在删除任何内容之前将其全部关闭。

  2. 转到目录并删除整个 org.swift.swiftpm 目录(不仅是 collection 目录,而是整个 org.swift.swiftpm > 目录),如果还有一个 org.swift.swiftpm.lock,也删除它。

输入图像描述这里

I faced this problem after I installed Xcode 14.0.
Deleting org.swift.swiftpm worked for me:

  1. Make sure that anything related to SPM is not running including Xcode. Close them all before you delete anything.

  2. Go to directory and delete the entire org.swift.swiftpm directory (Not only collection directory, but the whole org.swift.swiftpm directory) and if there is also a org.swift.swiftpm.lock, delete that one as well.

enter image description here

以可爱出名 2025-01-16 20:14:22

该警告表明您需要删除该文件。

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

所以请删除它,这会有帮助。

The warning says that you need to delete the file.

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

So please delete it and it will help.

子栖 2025-01-16 20:14:22

根据 @jalone 的评论,这可能会导致 Xcode 在打开项目时崩溃。在我的例子中它没有这样做,但我拥有的只是通用的 Apple 集合: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 提案文档

Based on a comment from @jalone, this may cause Xcode to crash upon opening the project. It did not do that in my case but all I had was the generic Apple collections: https://developer.apple.com/swift/packages/collections/apple.json

Proceed with caution

It looks like all I needed to do is run this to get rid of the warning.

rm ~/.swiftpm/config/collections.json

There should be an additional collections.json located at ~/.swiftpm/config/configuration/collections.json that is where the packages are now stored when you use

swift package-collection add <package.json>

For more information see the SE proposal documentation here

浪漫之都 2025-01-16 20:14:22

转到路径并打开 org.swift.swiftpm 文件,它将在 IDE 中打开,然后删除配置文件夹外部可用的 collection.json。警告将得到解决。

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. warning will be resolved.

人间☆小暴躁 2025-01-16 20:14:22

我在 Xcode 14 RC 中看到了此警告,并能够通过删除并重新添加我的一个包(在“项目”>“包依赖项”下)来解决它。

I saw this warning in Xcode 14 RC and was able to resolve it by removing and re-adding one of my packages (under Project > Package Dependencies).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文