XCode:在Xcode 14中使用软件包

发布于 2025-02-07 11:12:29 字数 870 浏览 1 评论 0原文

我的项目中有几个快速套餐。

Xcode 13.4.1正常工作。

Using Xcode 14 beta 1, all packages fail to build because of an error referencing to one of my packages:

Showing All Messages
Cannot clone from local directory /Users/...
Please git init or use "path:" for Location(scratchDirectory...

I tried:

  • in Xcode: removing the reference to the package and adding it again
  • in Xcode: removing the reference, moving the directory to a different place, create a fresh package in Xcode, move the old files into the new package directory
  • The usual Clean Build Folder and Reset Package Caches
  • creating the imported package under a new name and import the new one

The packages are part of the project (when creating: ... add to project and directory in the project)

I have several Swift packages in my project.

Works fine with Xcode 13.4.1.

Using Xcode 14 beta 1, all packages fail to build because of an error referencing to one of my packages:

Showing All Messages
Cannot clone from local directory /Users/...
Please git init or use "path:" for Location(scratchDirectory...

I tried:

  • in Xcode: removing the reference to the package and adding it again
  • in Xcode: removing the reference, moving the directory to a different place, create a fresh package in Xcode, move the old files into the new package directory
  • The usual Clean Build Folder and Reset Package Caches
  • creating the imported package under a new name and import the new one

The packages are part of the project (when creating: ... add to project and directory in the project)

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

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

发布评论

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

评论(1

热风软妹 2025-02-14 11:12:29

本地软件包的语法有一个更改,.package(url:…语法曾经在项目中使用的软件包不再起作用。

使用Xcode 14本地软件包,没有其必须将自己的存储库称为:

dependencies: [
    .package(path: "../MyLibrary"),
]

现在在Xcode 14 beta中可以正常工作,但是如果您要返回Xcode Release版本,则会获得许多错误来修复这些错误,并通过调用

重置软件包

我在一个带有14个内部软件包的项目中遇到了相同的问题,其中一些依赖于对方,现在在Xcode 13.4和Xcode 14 Beta中运行

> CACHES重置caches。 File> gatages&gt ; 帮助

There is a change in the syntax for local packages, the .package(url: … syntax that used to work for packages within the project does not work anymore.

With Xcode 14 local packages that do no have their own repo MUST be referred as:

dependencies: [
    .package(path: "../MyLibrary"),
]

Now this works just fine in Xcode 14 beta, but if you're going back to the Xcode release version, you'll get numerous errors. To fix those, reset the package caches by calling

File > Packages > Reset Package Caches

I had the same issue in a project with 14 internal packages, some of them dependent on each other, and it runs fine now in both Xcode 13.4 and Xcode 14 beta.

Hope it helps

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