最新消息:20190717 VPS服务器:Vultr新加坡,WordPress主题:大前端D8,统一介绍入口:关于

【已解决】Xcode9链接出错:ChartsRealm.framework ChartsRealm compiled with older version of Swift language 3.0 than previous files 4.0 file

Xcode crifan 1747浏览 0评论

折腾:

【部分解决】通过下载和安装使用Xcode9避免Xcode8索引和编译极其慢的问题

期间,去编译,但是链接出错:

ld: /Users/crifan/dev/dev_root/xxxxxx/Carthage/Build/iOS/ChartsRealm.framework/ChartsRealm compiled with older version of Swift language (3.0) than previous files (4.0) file ‘/Users/crifan/dev/dev_root/xxxxxx/Carthage/Build/iOS/ChartsRealm.framework/ChartsRealm’ for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

ChartsRealm.framework ChartsRealm compiled with older version of Swift language 3.0 than previous files 4.0 file

Charts Realm.framework Chart Realm compiled with older version of Swift language 3.0 than previous files 4.0 file

Realm for iOS in Xcode 8 & Swift 3 · Issue #3932 · realm/realm-cocoa

先去看看旧的文件是什么

发现两个文件是同一个路径啊:

/Carthage/Build/iOS/ChartsRealm.framework/ChartsRealm

好像的确是旧的:

文件最新修改时间是9月1号

而不是今天9月19号

compiled with older version of Swift language 3.0 than previous files 4.0 file

Alamofire compiled with older version of Swift language (2.0) than previous files (3.0) for architecture x86_64 – Stack Overflow

去清除Derived Data:

然后Xcode9中Clean后重新编译

结果问题依旧。

ios – Xcode linking error after updating to 8.0 version – Stack Overflow

去设置:

Use Legacy Swift Language Version=YES

试试

结果找不到这个参数了:

Xcode 8 GM – Alamofire 3.5 – Linker command failed · Issue #1479 · Alamofire/Alamofire

Pods automatically compiling with Swift 4.0 in Xcode 9 beta 1 · Issue #6791 · CocoaPods/CocoaPods

然后再去看Carthage中build出来的库,觉得很是诡异:

Realm的别的库:

Realm.framework

RealmSwift.framework

都是新编译出来,最后修改时间都是今天

以及:

Charts.framework

但是为何这个:

ChartsRealm.framework

(和相关的:ChartsRealm.framework.dSYM)

(以及其他不相关的:

CoreActionSheetPicker.framework.dSYM

DLRadioButton.framework.dSYM

却没有重新编译?

去看了之前编译的输出:

*** Building scheme “Charts” in Charts.xcodeproj

*** Building scheme “RealmSwift” in Realm.xcworkspace

*** Building scheme “Realm” in Realm.xcworkspace

好像没有这个ChartsRealm?

搜一下:

ChartsRealm

ChartsRealm.framework

danielgindi/ChartsRealm: A Realm.io module for Charts

ios-charts/ChartsRealm at master · PhilJay/ios-charts

Developers – Error with carthage update ChartsRealm fails to build –

Module ‘Realm’ not found in v2.2.1 · Issue #735 · danielgindi/Charts

以及自己的:

[未解决]Carthage去安装Charts库时编译ChartsRealm-iOS出错:Ld armv7/Charts normal armv7 – 在路上

ChartsRealm.framework ld error

ChartsRealm.framework ld error xcode9

另外发现项目中没有用到:

ChartsRealm

算了,去把

Targets-》General-》Linked Frameworks and Libraries中的ChartsRealm.framework

从Required改为Optional

看看能否正常编译(期望是,此处代码中实际上没有引用到对应的函数或库,则就无须引用此库了)

问题依旧。

算了,

Targets-》General-》Linked Frameworks and Libraries中,去掉这个:

ChartsRealm.framework

看看能否正常编译。

点击减号:

三个target中都删除掉:

再去clean后编译,结果

出错:

【已解决】Xcode9中编译出错:The following binaries use incompatible versions of Swift ChartsRealm.framework

【总结】

此处是通过把ChartsRealm.framework从项目中彻底去除掉,从而避免了该问题。

具体原因和步骤详见:

【已解决】Xcode9中编译出错:The following binaries use incompatible versions of Swift ChartsRealm.framework

转载请注明:在路上 » 【已解决】Xcode9链接出错:ChartsRealm.framework ChartsRealm compiled with older version of Swift language 3.0 than previous files 4.0 file

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
67 queries in 0.235 seconds, using 18.84MB memory