英文:
macOS - Crashlytics
问题
我已成功为 macOS 应用程序安装了 Crashlytics。
问题是,当我运行 xcodebuild
时,我会收到以下错误信息:
建立描述路径:/Users/user/Software/macos-project/build/XCBuildData/1de1a3320b63060eeac8ee6054441eab.xcbuilddata
警告:构建目标的手动顺序已被弃用 - 在项目编辑器中检查“为命令行构建并行化构建”,或在当前构建中的任何目标中设置 DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING 以抑制此警告
ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk /var/folders/3y/wxqdg41958n7cl4xdf9qzxxh0000gn/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache
cd /Users/user/Software/macos-project/project.xcodeproj
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -o /var/folders/3y/wxqdg41958n7cl4xdf9qzxxh0000gn/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
cd /Users/user/Software/macos-project/project.xcodeproj
builtin-create-build-directory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
error: 文件已存在,但不是目录:/Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs/Release
cd /Users/user/Software/macos-project/project.xcodeproj
builtin-create-build-directory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs/Release
error: 文件已存在,但不是目录:/Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs
警告:请求了 ONLY_ACTIVE_ARCH=YES,但无法计算多个 ARCHS 的活动架构;将为所有适用的体系结构构建(在项目“project”中的目标中)
警告:由于未指定任何输出,将在每次构建期间运行脚本构建阶段“Swiftlint”。要解决此警告,请向脚本阶段添加输出依赖项,或通过在脚本阶段中取消选中“基于依赖分析”来配置它在每次构建期间运行。 (在项目“project”中的目标中)
警告:由于未指定任何输出,将在每次构建期间运行脚本构建阶段“Firebase”。要解决此警告,请向脚本阶段添加输出依赖项,或通过在脚本阶段中取消选中“基于依赖分析”来配置它在每次构建期间运行。 (在项目“project”中的目标中)
** 构建失败 **
以下构建命令失败:
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs/Release
请注意,如果我通过 Xcode 运行此项目,似乎一切正常。
英文:
I have successfully installed Crashlytics for a macOS app.
The issue is that when I run xcodebuild
I get the following error:
<!-- begin snippet: js hide: false console: true babel: false -->
<!-- language: lang-html -->
Build description path: /Users/user/Software/macos-project/build/XCBuildData/1de1a3320b63060eeac8ee6054441eab.xcbuilddata
warning: Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
ClangStatCache /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk /var/folders/3y/wxqdg41958n7cl4xdf9qzxxh0000gn/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache
cd /Users/user/Software/macos-project/project.xcodeproj
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-stat-cache /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk -o /var/folders/3y/wxqdg41958n7cl4xdf9qzxxh0000gn/C/com.apple.DeveloperTools/14.3-14E222b/Xcode/SDKStatCaches.noindex/macosx13.3-22E245-.sdkstatcache
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
cd /Users/user/Software/macos-project/project.xcodeproj
builtin-create-build-directory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
error: File exists but is not a directory: /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs/Release
cd /Users/user/Software/macos-project/project.xcodeproj
builtin-create-build-directory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs/Release
error: File exists but is not a directory: /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs
warning: ONLY_ACTIVE_ARCH=YES requested with multiple ARCHS and no active architecture could be computed; building for all applicable architectures (in target 'project' from project 'project')
warning: Run script build phase 'Swiftlint' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'project' from project 'project')
warning: Run script build phase 'Firebase' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'project' from project 'project')
** BUILD FAILED **
The following build commands failed:
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
CreateBuildDirectory /Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs/Release
<!-- end snippet -->
Please note that if I run this through Xcode, it seems to be working fine.
答案1
得分: 2
这似乎可能与xcodebuild的调用相关。
尝试在您的xcodebuild
调用中使用-scheme
参数传递一个方案。要获取有效的方案名称列表,请在项目的目录中运行xcodebuild -list
。
看起来像这样:xcodebuild -scheme $(YOUR_SCHEME_HERE)
不同之处似乎在于,传递了一个方案后,生成的文件将放入不同的文件夹,而不是软件包存储库的检出。因此,当xcodebuild没有参数运行时,它可能会损坏DerivedData中检出的SPM存储库。
英文:
This seems like it might be related to the xcodebuild invocation.
Try passing a scheme to your xcodebuild
invocation using the -scheme
argument. To get a list of valid schemes names, run xcodebuild -list
in your project's directory.
It will look like: xcodebuild -scheme $(YOUR_SCHEME_HERE)
The difference seems to be that, with a scheme passed, artifacts go into a different folder rather than the package repo checkouts. So when xcodebuild runs without arguments, it can corrupt the checked out SPM repos in DerivedData.
答案2
得分: 0
尝试手动删除出问题的目录:您可以导航到指定的路径,手动删除导致问题的目录。在您的情况下,删除以下目录:
/Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
/Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs
英文:
Try to delete the problematic directories manually: You can navigate to the specified paths and manually delete the directories that are causing the issue. In your case, delete the following directories:
/Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/Release
/Users/user/Library/Developer/Xcode/DerivedData/project-enqmgygeiagmohbnywjtetshcnrr/SourcePackages/checkouts/nanopb/build/EagerLinkingTBDs
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论