迦太基更新失败,错误消息SWIFT_VERSION'5.0'不受支持,支持的版本为:3.0,4.0,4.2

问题描述 投票:0回答:2

目前我在xcode版本10.1和swift版本4.2上。我正在使用CryptoSwift lib,当我尝试使用carthage update时,它无法使用错误消息SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2构建。

我正在尝试解决问题:

  1. if swift_verion > 4.2 { //Download x version }else { //Download y version }
  2. 或者有任何方法只使用可用版本编译构建?
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
    TOOLCHAINS = com.apple.dt.toolchain.Swift_4_2

note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'CryptoSwift')
ios swift carthage
2个回答
1
投票

似乎CryptoSwift lib在最新版本(1.0.0)中使用Xcode 10.2更新为Swift 5。您收到此错误是因为如果要指向此新版本,则需要更新Xcode版本并将项目迁移到Swift 5。使用Swift 5的项目只能使用Xcode 10.2构建。

请注意,Apple很快就会放弃对Swift 3的支持,很快就升级它可能是一个好主意。在迁移期间管理依赖项可能会很麻烦,因为您无法控制其他开发团队何时切换。


0
投票

我在Cartfile中使用以下内容修复它:

github "krzyzanowskim/CryptoSwift" "swift42"

这使用CryptoSwift的Swift 4.2分支,您不必转换您的项目。

© www.soinside.com 2019 - 2024. All rights reserved.