Xcode升级到10.0,运行项目报错解决方法

收到iOS12.0更新推送,网上各种说更新之后手机流畅度能提升70%,那个心里激动的呀,对于iOS开发者来说,更新手机必然需要更新Xcode,要不真机都不让运行,Xcode从9.4.1更新到10.0之后开始报编译错误,下面来说说如何解决。

报错1:
:-1: Multiple commands produce '/Users/Simon/Library/Developer/Xcode/DerivedData/YueMeTV-emcpejoowcofgfdbrhckdzciyxgk/Build/Products/Debug-iphoneos/YueMeTV.app/Info.plist':
1) Target 'YueMeTV' (project 'YueMeTV') has copy command from '/Users/Simon/Desktop/公信/SmartHome_UIUE_New/Src/YueMeTV/yueme_cloud/Info.plist' to '/Users/Simon/Library/Developer/Xcode/DerivedData/YueMeTV-emcpejoowcofgfdbrhckdzciyxgk/Build/Products/Debug-iphoneos/YueMeTV.app/Info.plist'
2) Target 'YueMeTV' (project 'YueMeTV') has process command with output '/Users/Simon/Library/Developer/Xcode/DerivedData/YueMeTV-emcpejoowcofgfdbrhckdzciyxgk/Build/Products/Debug-iphoneos/YueMeTV.app/Info.plist'

解决链接:Xcode 10 Error: Multiple commands produce

文中的步骤是 Xcode->File->Project Settings-> Build System -> Legacy Build System.
1、In Xcode, go to File->Project/Workspace settings
2、Change the build system to Legacy Build system

报错2:
ld: warning: directory not found for option '-F/Users/Simon/Desktop/公信/SmartHome_UIUE_New/Src/YueMeTV/tools/TYLoginSDK'
ld: library not found for -lstdc++.6.0.9
clang: error: linker command failed with exit code 1 (use -v to see invocation)

解决完上述再编译报缺少lstdc++.6.0.9库,在新xcode中发现已经去掉libstdc++.6.0.9,这就意味着项目中如果有第三方或者自己使用到lstdc++.6.0.9的地方都会报编译错误。

临时解决方案

1、 找到Xcode10之前的版本,搜索下面路劲找到libstdc++.6.0.9,
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
2、拷贝libstdc++.6.0.9到Xcode10.0对应路径下,再编译就不会报错了。

参考链接:
Xcode 10 (iOS 12) does not contain libstdc++6.0.9
关于Xcode 10.0编译不通过的问题 stdc++.6.0.9

你可能感兴趣的:(Xcode升级到10.0,运行项目报错解决方法)