You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Swift版本不兼容致RiveRuntime导入失败,求解决办法

解决RiveRuntime模块编译失败的Swift版本不匹配问题

以下是几种可行的解决办法:

  • 更新RiveRuntime到兼容当前Swift版本的版本
    打开项目根目录的Podfile,保持pod 'RiveRuntime'配置(或明确指定最新兼容版本),然后在终端执行:

    pod update RiveRuntime
    

    重新安装后,新的Pod包会适配你当前Xcode的Swift 5.7.2版本。

  • 降级Xcode到对应Swift 5.6的版本
    Swift 5.6对应的是Xcode 13.3系列版本,若不想更新Pod,可下载该版本的Xcode。安装完成后,通过Xcode > 设置 > 位置,切换到这个旧版本的Xcode工具链,即可匹配Pod的编译版本。

  • 强制Pods使用当前Swift版本重新编译
    在Podfile末尾添加以下配置代码,强制所有依赖包使用项目当前的Swift 5.7.2版本编译:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '5.7.2'
        end
      end
    end
    

    保存后执行pod install,重新安装依赖,RiveRuntime会用当前编译器版本重新构建。

内容的提问来源于stack exchange,提问作者CodeLearner

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 09:52:06