使用Xcode 10.1 +迦太基在同一Cartfile中构建Alamofire和Texture时出错

时间:2018-11-10 17:50:01

标签: ios swift alamofire carthage

我有一个同时使用Alamofire和Texture的iOS项目。我无法同时使用Carthage和Xcode 10.1同时构建两者。

  • 对于carthage update --platform ios,Alamofire失败,因为“当前目标不支持线程本地存储”
  • 使用@Saik0s workaround script,Alamofire失败,根本没有消息(下面记录)

还有其他人在Carthage,Alamofire和Xcode 10.1上获得成功吗?

出现故障的空项目位于github/kenstir/swift-samples/SadCarthage

迦太基输出

macken:SadCarthage kenstir$ ./carthage-update 
*** Cloning Alamofire
*** Cloning texture
*** Cloning PINCache
*** Cloning PINRemoteImage
*** Cloning PINOperation
*** Cloning libwebp
*** Checking out Alamofire at "4.7.3"
*** Checking out PINCache at "3.0.1-beta.6"
*** Checking out texture at "2.7"
*** Checking out PINRemoteImage at "3.0.0-beta.13"
*** Checking out PINOperation at "1.1.1"
*** Checking out libwebp at "v0.6.0"
*** Downloading PINOperation.framework binary at "Just fixing some warnings"
*** Downloading PINCache.framework binary at "3.0.1-beta.6"
*** Downloading PINRemoteImage.framework binary at "3.0 beta 13: Animated WebP support / better GIF handling"
*** xcodebuild output can be found in /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
Build Failed
    Task failed with exit code 4:
    /usr/bin/xcrun xcodebuild -workspace /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ iOS -configuration Release -derivedDataPath /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log

xcodebuild日志

macken:SadCarthage kenstir$ cat /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/carthage-xcodebuild.H7FuEl.log
/usr/bin/xcrun xcodebuild -workspace /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire/Alamofire.xcworkspace -scheme Alamofire\ iOS -configuration Release -derivedDataPath /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/kenstir/Documents/xcode/swift-samples/SadCarthage/Carthage/Checkouts/Alamofire)User defaults from command line:
    IDEArchivePathOverride = /var/folders/r7/c4y6r2q156xbl58p59x61_740000gr/T/Alamofire
    IDEDerivedDataPathOverride = /Users/kenstir/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/Alamofire/4.7.3

Build settings from command line:
    CARTHAGE = YES
    CLANG_ENABLE_CODE_COVERAGE = NO
    CODE_SIGN_IDENTITY = 
    CODE_SIGNING_REQUIRED = NO
    GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphoneos12.1
    SKIP_INSTALL = YES
    STRIP_INSTALLED_PRODUCT = NO

Build settings from configuration file '/tmp/static.xcconfig.30m4Ve':
    ONLY_ACTIVE_ARCH = 

更新

我从上述消息ONLY_ACTIVE_ARCH =(空)中得到了一个线索,所以我像这样编辑了carthage-update脚本:

--- SadCarthage/carthage-update
+++ SadCarthage/carthage-update
@@ -8,7 +8,8 @@ IFS=$'\n\t'

 xcconfig=$(mktemp /tmp/static.xcconfig.XXXXXX)
 trap 'rm -f "$xcconfig"' INT TERM HUP EXIT
-echo "ONLY_ACTIVE_ARCH[sdk=iphonesimulator*] = YES" >>$xcconfig
+echo "ONLY_ACTIVE_ARCH = YES" >>$xcconfig
 export XCODE_XCCONFIG_FILE="$xcconfig"

+cat $xcconfig
 carthage update --platform ios $@

现在可以构建了!我不相信这是最终的答案,但到目前为止对我来说仍然有效。

0 个答案:

没有答案