技術と本について書くブログ

技術と本について書くblog。技術メモなど雑記を書いているblog。

Xcode betaでCartahgeがxcrun lipoでうまくいかない時の対処方法

Xcode 12 beta3で突然エラーが発生するように

エラー内容

cartahge update した際に以下のようなエラ〜メッセージが(こちらはissueから)

fatal error: /Applications/Xcode-12-beta-3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/swarn1/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A8169g/JWTDecode.swift/2.4.1/Build/Intermediates.noindex/ArchiveIntermediates/JWTDecode-iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/JWTDecode.framework/JWTDecode and /Users/swarn1/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A8169g/JWTDecode.swift/2.4.1/Build/Products/Release-iphonesimulator/JWTDecode.framework/JWTDecode have the same architectures (arm64) and can't be in the same fat output file

対処方法

helper.xcconfigを作成 中身``` XCLUDED_ARCHSEFFECTIVE_PLATFORM_SUFFIX_simulatorNATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8 EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHSEFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))

以下を実行してxconfigを適用させてcarthage updateする

export XCODE_XCCONFIG_FILE=$PWD/helper.xcconfig carthage update --platform iOS --no-use-binaries

参考:

[https://github.com/Carthage/Carthage/issues/3019]