升级Xcode10错误记录

1、Multiple commands produce

error: Multiple commands produce 
'/Users/galahad/Library/Developer/Xcode/DerivedData/xxxxx-drnrntneloepunakcqbcdycudqeh/Build/Products/Debug-iphoneos/xxxxx.app':
1)Target 'xxxxx' has create directory command with output 
'/Users/galahad/Library/Developer/Xcode/DerivedData/xxxxx-drnrntneloepunakcqbcdycudqeh/Build/Products/Debug-iphoneos/xxxxx.app'
2)That command depends on command in Target 'xxxxx': script phase “[CP] Copy Pods Resources”
错误原因:

Xcode 10 默认使用的Build System是New Build System,与Xcode9不同。

解决方法:

1)方法一:移除Target -> Build phase -> Copy Pods Resources -> Output Files ->{TARGET_BUILD_DIR}/{UNLOCALIZED_RESOURCES_FOLDER_PATH} 。这个方法解决不彻底,重新pod install后,这个path会重新出现,需要重新删除。
2)方法二:修改Build System。通过Xcode菜单栏 -> File -> Workspace Setting,将Build System修改为Legacy Build System

2、Jenkins打包时提示Multiple commands produce...,但真机测试没问题

错误原因:

Jenkins打包时默认使用的是New build system,而不管你Xcode里是如何设置的。

解决方法:

archive时添加xcodebuild指令-UseModernBuildSystem=NO,指定不使用当前的编译系统。参考:How can I use the legacy build system with Xcode 10's xcodebuild?

3、 library not found for -lstdc++.6.0.9

ld: library not found for -lstdc++.6.0.9
clang: error: linker command failed with exit code 1 (use -v to see invocation)
错误原因:

Xcode10中已去除这个library。项目中有用到的话,可以从旧版本Xcode中copy一份过来。

解决方法:

从旧版本Xcode的library复制一份libstdc++.6.0.9.tbd,放到Xcode10对应目录下。
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib(真机)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib(模拟器)

4、Cycle inside xxxxx; build could produce unreliable results

Cycle inside xxxxx; build could produce unreliable results. 
This can usually be resolved by moving the app extension embedding build phase to the end of the list.
Cycle details:xxxxx
解决方法:

根据提示,在Target ->Build Phases下,把Embed APP Extensions移动到列表末尾,问题解决。

5、讯飞语音识别SDK报错

Undefined symbols for architecture arm64:
"_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)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
错误原因:

找不到与Contact相关的key。

解决方法:

添加Contacts.framework

你可能感兴趣的:(升级Xcode10错误记录)