XCode10 更新后遇到的几个编译失败的问题

这两天由于同事都相继更新了系统和XCode10导致有些没更新系统和XCode的同事代码遇到一些问题,下面列出我遇见的几个问题:

问题一、Build input file cannot be found:'/Users/xxxxx/lib/DataLib/build/Debug-iphoneos/libDataLib.a'

报错图片如下:


xxx.a找不到.png

问题二、Multiple commands produce

问题详情

:-1: Multiple commands produce '/Users/mac/Library/Developer/Xcode/DerivedData/NewAirCloud-aleqredxbgkylvbkglvqefavfggd/Build/Products/Debug-iphoneos/NewAirCloud.app/Info.plist':
1) Target 'NewAirCloud' (project 'NewAirCloud') has copy command from '/Users/mac/Desktop/NewAirCloud-iOS/NewAirCloud/NewAirCloud/External/BaiDuAR/Vendors/SSZipArchive/Info.plist' to '/Users/mac/Library/Developer/Xcode/DerivedData/NewAirCloud-aleqredxbgkylvbkglvqefavfggd/Build/Products/Debug-iphoneos/NewAirCloud.app/Info.plist'
2) Target 'NewAirCloud' (project 'NewAirCloud') has process command with output '/Users/mac/Library/Developer/Xcode/DerivedData/NewAirCloud-aleqredxbgkylvbkglvqefavfggd/Build/Products/Debug-iphoneos/NewAirCloud.app/Info.plist'

问题截图如下:


Multiple commands.png

错误原因:

原因是XCode10更改默认的编译系统如下图:


projectSetting.png

问题一、二、解决办法:

1.点击File --> Project Setting --> Build System 选择Legacy Build System -->Done
2.command + shift +k:清理缓存即可编译成功


1
2.png

问题三、ld: library not found for -lstdc++.6.0.9

问题截图:


libstdc++.6.0.9.png

问题原因:

Xcode 10 中移除了 “-libstdc++.6.0.9” 等一些过期很久的库

解决办法:

1.移除-libstdc++.6.0.9
TARGETS --> Build Phases -->Link Binary With Libraries 找到libstdc++.6.0.9选中点击➖图标移除

1

2.需要在旧版Xcode 9 中查找到“-lstdc++.6.0.9”库之后,复制一份放入Xcode 10 lib库中。
具体操作连接:https://www.jianshu.com/p/3e29e9d897c8

问题四:"OBJC_CLASS$_CNContactStore", referenced from:objc-class-ref in iflyMSC(IFlyContact.o)

"_OBJC_CLASS_$_CNContactStore", referenced from:
      objc-class-ref in iflyMSC(IFlyContact.o)
  "_OBJC_CLASS_$_CNContactFetchRequest", referenced from:
      objc-class-ref in iflyMSC(IFlyContact.o)
  "_CNContactGivenNameKey", referenced from:
      -[IFlyContact fetchContactWithContactStore:] in iflyMSC(IFlyContact.o)
  "_CNContactFamilyNameKey", referenced from:
      -[IFlyContact fetchContactWithContactStore:] in iflyMSC(IFlyContact.o)

问题截图:


科大讯飞.png

问题原因:

科大讯飞sdk需要添加以下四个依赖库,升级Xcode10后莫名找不到这些依赖库


image.png

解决办法:

添加相应依赖:TARGETS --> Build Phases -->Link Binary With Libraries点击➕号,搜索相应framework,点击add

1.png
2.png

你可能感兴趣的:(XCode10 更新后遇到的几个编译失败的问题)