SPM XCode 14, Failed to load container at path

Hello good morning!

I am having a problem that is only happening when building by Bitrise, using Xcode 14.2.x, on macOS 13.0 (Ventura) , M1 Elite XL. It always gives error in the same phase:

[18:09:47]: ▸ 2022-12-28 18:09:47.467 xcodebuild[17837:44642] [MT] IDEFileReferenceDebug: [Load] <IDESwiftPackageCore.IDESwiftPackageSpecialFolderFileReference, 0x600005c00b00: name:Docs.docc path:group:Docs.docc> Failed to load container at path: /Users/vagrant/git/SourcePackages/checkouts/swift-protobuf/Sources/protoc-gen-swift/Docs.docc, Error: Error Domain=com.apple.dt.IDEContainerErrorDomain Code=6 "Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder"." UserInfo={NSLocalizedDescription=Cannot open "Docs.docc" as a "Swift Package Folder" because it is already open as a "Folder".}
[18:09:52]: ▸ ** ARCHIVE FAILED **

When I use XCode 13, in bitrise, this problem doesn’t occur. And testing with the same stack locally, using bitrise run it builds normally.

Does anyone have any idea why this occurs? I’ve tried looking on the internet but I haven’t been able to find an answer :frowning:

From what I can tell this looks like an Apple bug.

Hi Damien, thanks for the reply!

I had come across with this link, but the strangest thing is that this error only happens when running on bitrise, but it works when running on laptop with the same version of XCode and macOS.

Can you submit a support ticket so we can investigate further?


Sure! I just opened and enabled Support Access.


Hello good afternoon!
Just to let you know, I managed to solve the problem, in fact it wasn’t related to the .docc, it was a false positive. The problem was a security modification of XCode 14 that as I understand it modified how codesign with CocoaPods was done.

I applied the solution in this comment here:

What remains a mystery is why it worked on my computer, but not on bitrise. The solution reported above solves both cases.