Swift Package Manager依赖关系将赢得构建:“显示所有错误仅命令commilesWiftSources失败,而非零退出代码”
由于某种原因,每当我尝试通过SPM更新依赖关系时,我都会得到构建错误。由于某种原因,我的团队中的其他人可以很好地获取。同一版本的MacOS,同一版本的Xcode,来自Git的同一分支。
供参考 Macos Monterey 12.3.1 XCode 13.2.1
- 我在输入此输入时下载13.3.1。
这是我试图解决此问题的步骤。自从我绝望以来,我去了全焦球。
- 封闭的Xcode
- 克隆来自GIT
- 删除的派生数据
- 的新存储库进入了工作区并清除软件包。
- 我遇到了问题的问题,即包裹的解决方案被别人的登记室弄乱了
- 我尝试没有清除包裹。与结果相同的结果
- 解决
- 。 -scheme *schemename *-project *project *.xcodeproj -configuration debug
- 我也通过Xcode完成了此操作,但这常常被卡住了。
完成以下操作后,我将打开Xcode并尝试运行,并遇到相同的错误。
这是构建日志:
Build target *InternalOBJCFramework* with configuration Debug
*removed*
Undefined symbols for architecture arm64:
"___llvm_profile_runtime", referenced from:
___llvm_profile_runtime_user in *InternalOBJCFramework*.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build target Socket with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Socket' from project 'Socket')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target KeychainAccess with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'KeychainAccess' from project 'KeychainAccess')
*removed*
error: jobFailedWithNonzeroExitCode(2, "")
Command CompileSwiftSources failed with a nonzero exit code
Build target BTree with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'BTree' from project 'BTree')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target Rswift with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Rswift' from project 'R.swift.Library')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target CombineExt with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'CombineExt' from project 'CombineExt')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target ReactiveSwift with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'ReactiveSwift' from project 'ReactiveSwift')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target XCGLogger with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'XCGLogger' from project 'XCGLogger')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
让我们使用SPM说,他们说会更容易。
For some reason whenever I try to update my dependencies through SPM I get build errors. Others on my team can fetch fine, for some reason I have a hexed machine. Same version of macOS, same version of XCode, same branch from git.
FYI
macOS Monterey 12.3.1
XCode 13.2.1
- I'm downloading 13.3.1 as I type this.
Here are the steps I've used to try to fix this problem. I went full scorched earth since I'm desperate.
- closed Xcode
- cloned new repo from Git
- deleted derived data
- went into the workspace and cleared package.resolve
- I've had problems where the package resolve was messed up from someone else's check-in
- I've tried not clearing the package.resolve with the same result
- cd into project directory in the terminal
- fetched dependencies through command line
xcodebuild -resolvePackageDependencies -scheme *schemeName* -project *project*.xcodeproj -configuration Debug
- I've also done this through xcode but this often times gets stuck.
After I've done the following I'll open XCode and try to run and I'm met with the same errors.
Here's the build log:
Build target *InternalOBJCFramework* with configuration Debug
*removed*
Undefined symbols for architecture arm64:
"___llvm_profile_runtime", referenced from:
___llvm_profile_runtime_user in *InternalOBJCFramework*.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build target Socket with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Socket' from project 'Socket')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target KeychainAccess with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'KeychainAccess' from project 'KeychainAccess')
*removed*
error: jobFailedWithNonzeroExitCode(2, "")
Command CompileSwiftSources failed with a nonzero exit code
Build target BTree with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'BTree' from project 'BTree')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target Rswift with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Rswift' from project 'R.swift.Library')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target CombineExt with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'CombineExt' from project 'CombineExt')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target ReactiveSwift with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'ReactiveSwift' from project 'ReactiveSwift')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Build target XCGLogger with configuration Debug
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'XCGLogger' from project 'XCGLogger')
*removed*
Command CompileSwiftSources failed with a nonzero exit code
Let's use SPM they said, it'll be easier they said. ????????♂️
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题发生在我要涉及的依赖性的情况下。
The problem happened with a dependency I'm pulling in that had it's package.swift file define itself as being dynamic.