在swift项目中,用carthage管理第三方库。

然后,执行carthage update --platform iOS
时候,报错Task failed with exit code 1:
如下图所示:

解决办法:
在命令行目录下,新建 xxx.xcconfig
文件
复制一下内容,粘贴到xxx.xcconfig
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8\
EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))}

在此文件目录下执行:(以后加入新第三方库时候依然要先执行这句命令)
export XCODE_XCCONFIG_FILE=$PWD/xxx.xcconfig
执行:
carthage update --platform iOS --no-use-binaries --cache-builds
网友评论