gpt4 book ai didi

ios - Carthage 无法为 Xcode 机器人构建 obj-c 文件的 Nimble : cannot import

转载 作者:行者123 更新时间:2023-12-02 22:48:17 28 4
gpt4 key购买 nike

摘要当构建服务器下载项目并厌倦在项目上调用 carthage bootstrap/update 时,它​​无法构建 Nimble。

详细信息我将手动下载源代码并运行以下命令

carthage bootstrap Quick Nimble --platform ios --cache-builds
# or
carthage update Quick Nimble --platform ios --cache-builds

如果这发生在 ~/Projects 目录中,一切都很好,Carthage 很高兴。

如果我允许 Xcode Bot 下载并运行它,它会失败。因此,我登录到服务器并根据 Xcode Bots 创建的构建目录进行构建,即

~/Library/Caches/XCSBuilder/Bots/8e543991f99daae3015cbc6c419dba56/Source/myProject 我在日志中得到以下内容

/***someUserDirectory***/Library/Caches/XCSBuilder/Bots/8e543991f99daae3015cbc6c419dba56/Source/airlib/Carthage/Checkouts/Nimble/Sources/NimbleObjectiveC/NMBStringify.m:6:9: fatal error: 'Nimble/Nimble-Swift.h' file not found
#import <Nimble/Nimble-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

这是compileC命令

CompileC /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.o /***someUserDirectory***/Library/Caches/XCSBuilder/Bots/8e543991f99daae3015cbc6c419dba56/Source/airlib/Carthage/Checkouts/Nimble/Sources/NimbleObjectiveC/NMBStringify.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: Nimble-iOS)
cd /***someUserDirectory***/Library/Caches/XCSBuilder/Bots/8e543991f99daae3015cbc6c419dba56/Source/airlib/Carthage/Checkouts/Nimble
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/ModuleCache.noindex -fno-autolink -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=Nimble -fapplication-extension -Wno-trigraphs -fpascal-strings -Os -fno-common -Werror -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wnewline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DPRODUCT_NAME=Nimble/Nimble -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=8.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-generated-files.hmap -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-own-target-headers.hmap -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-all-non-framework-target-headers.hmap -ivfsoverlay /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/all-product-headers.yaml -iquote /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-project-headers.hmap -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Products/Release-iphonesimulator/include -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/DerivedSources-normal/x86_64 -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/DerivedSources/x86_64 -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/DerivedSources -F/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Products/Release-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -MMD -MT dependencies -MF /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.d --serialize-diagnostics /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.dia -c /***someUserDirectory***/Library/Caches/XCSBuilder/Bots/8e543991f99daae3015cbc6c419dba56/Source/airlib/Carthage/Checkouts/Nimble/Sources/NimbleObjectiveC/NMBStringify.m -o /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.o

对于该文件的 i386 版本,它也会给出类似的错误。只需将所有 x86_64 更改为 i386 即可。所以 NMBStringify 文件有两个错误。

当我在正常项目目录 ~/Projects/myproject/中运行 Carthage boostrap/update 时,构建正常,并且为同一文件打印以下内容

CompileC /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.o /***someUserDirectory***/Projects/airlib/Carthage/Checkouts/Nimble/Sources/NimbleObjectiveC/NMBStringify.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: Nimble-iOS)
cd /***someUserDirectory***/Projects/airlib/Carthage/Checkouts/Nimble
export LANG=en_US.US-ASCII
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/ModuleCache.noindex -fno-autolink -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -fmodule-name=Nimble -fapplication-extension -Wno-trigraphs -fpascal-strings -Os -fno-common -Werror -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wnewline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DPRODUCT_NAME=Nimble/Nimble -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=8.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-generated-files.hmap -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-own-target-headers.hmap -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-all-non-framework-target-headers.hmap -ivfsoverlay /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/all-product-headers.yaml -iquote /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Nimble-project-headers.hmap -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Products/Release-iphonesimulator/include -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/DerivedSources-normal/x86_64 -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/DerivedSources/x86_64 -I/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/DerivedSources -F/***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Products/Release-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -MMD -MT dependencies -MF /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.d --serialize-diagnostics /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.dia -c /***someUserDirectory***/Projects/airlib/Carthage/Checkouts/Nimble/Sources/NimbleObjectiveC/NMBStringify.m -o /***someUserDirectory***/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2/Build/Intermediates.noindex/Nimble.build/Release-iphonesimulator/Nimble-iOS.build/Objects-normal/x86_64/NMBStringify.o

几乎相同,但路径略有不同。由于某种原因,它找不到 Nimble 中构建 Obj-c 文件所需的头文件。

我一直不知道为什么 Xcode 在一个目录中找不到头文件,但在另一个目录中却找不到。我已经把项目从

中拿出来了

更多信息

当迦太基失败时以下日志输出来自删除旧 Carthage 目录的脚本,应该将其删除,因为我们不再上传 Carthage 文件,然后调用

carthage bootstrap --no-build
carthage bootstrap Quick Nimble --platform ios --cache-builds

这就是日志所说的

Git prune
Delete Old Carthage Directory
rm: Carthage: No such file or directory
Carthage Bootstrap
*** Checking out MBProgressHUD at "1.1.1"
*** Checking out XCGLogger at "7.0.0"
*** Cloning MBProgressHUD
*** Checking out CocoaAsyncSocket at "7.6.3"
*** Checking out Nimble at "v8.0.2"
*** Checking out Quick at "v2.1.0"
*** Checking out BlueSocket at "1.0.46"
*** Checking out Quick at "v2.1.0"
*** Checking out Nimble at "v8.0.2"
*** No cache found for Nimble, building with all downstream dependencies
*** No cache found for Quick, building with all downstream dependencies
*** xcodebuild output can be found in /var/folders/rc/28t61gwn3c1bcsn1b360d0h40000gq/T/carthage-xcodebuild.HH0nlH.log
*** Building scheme "Nimble-iOS" in Nimble.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/XcodeServer/Library/Caches/XCSBuilder/Bots/8e543991f99daae3015cbc6c419dba56/Source/airlib/Carthage/Checkouts/Nimble/Nimble.xcodeproj -scheme Nimble-iOS -configuration Release -derivedDataPath /Users/XcodeServer/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2_10E125/Nimble/v8.0.2 -sdk iphonesimulator -destination platform=iOS\ Simulator,id=5A944081-C045-401A-889E-72B41BB3C8CA -destination-timeout 3 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Users/XcodeServer/Library/Caches/XCSBuilder/Bots/8e543991f99daae3015cbc6c419dba56/Source/airlib/Carthage/Checkouts/Nimble)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/rc/28t61gwn3c1bcsn1b360d0h40000gq/T/carthage-xcodebuild.HH0nlH.log

这就是我手动执行时发生的情况

Git prune
Delete Old Carthage Directory
rm: Carthage: No such file or directory
Carthage Bootstrap
*** Checking out Quick at "v2.1.0"
*** Checking out SVProgressHUD at "2.2.5"
*** Checking out XCGLogger at "7.0.0"
*** Checking out Nimble at "v8.0.2"
*** Checking out BlueSocket at "1.0.46"
*** Checking out CocoaAsyncSocket at "7.6.3"
*** Checking out Nimble at "v8.0.2"
*** Checking out Quick at "v2.1.0"
*** No cache found for Nimble, building with all downstream dependencies
*** No cache found for Quick, building with all downstream dependencies
*** xcodebuild output can be found in /var/folders/rc/28t61gwn3c1bcsn1b360d0h40000gq/T/carthage-xcodebuild.GnvVo9.log
*** Building scheme "Nimble-iOS" in Nimble.xcodeproj
*** Building scheme "Quick-iOS" in Quick.xcworkspace

最佳答案

我升级到 XCode 11,现在它可以正确构建。

如果 Nimble 团队正在倾听,这个问题似乎只会在构建发布时才会出现。

关于ios - Carthage 无法为 Xcode 机器人构建 obj-c 文件的 Nimble : cannot import <Nimble/Nimble-Swift. h>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57581887/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com