XCode:在Xcode 14中使用软件包
我的项目中有几个快速套餐。
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
andReset 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
andReset 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本地软件包的语法有一个更改,
.package(url:…
语法曾经在项目中使用的软件包不再起作用。使用Xcode 14本地软件包,没有其必须将自己的存储库称为:
现在在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:
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