1、升级Xcode到Version 10.0 (10A255)后,运行已有项目,报如下错误:

error: Multiple commands produce '/Users/galahad/Library/Developer/Xcode/DerivedData/yoowei-drnrntneloepunakcqbcdycudqeh/Build/Products/Debug-iphoneos/yoowei.app':

1) Target 'yoowei' has create directory command with output '/Users/galahad/Library/Developer/Xcode/DerivedData/yoowei-drnrntneloepunakcqbcdycudqeh/Build/Products/Debug-iphoneos/yoowei.app'

2) That command depends on command in Target 'yoowei': script phase “[CP] Copy Pods Resources”

原因:Xcode 10 默认使用的build system是New build system,与Xcode9不同导致。

解决:2种方法

1)第一种方法 不修改build system 

根据error 日志,script phase “[CP] Copy Pods Resources”,而且与output有关,应该是使用了cocoapods导致的,尝试删除该项目target-Copy Pods Resources-Output Files,成功解决问题。选中项目target -> Build phase -> Copy Pods Resources -> Output Files -> 移除${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}  然后重新编译,OK 。

用这种方式紧接着会有下面的错误:

error: Cycle in dependencies between targets 'yooweiExtension' and 'yoowei'; building could produce unreliable results.

Cycle path: yooweiExtension → yoowei → yooweiExtension

Cycle details:

→ Target 'yooweiExtension': CodeSign /Users/galahad/Library/Developer/Xcode/DerivedData/yoowei-drnrntneloepunakcqbcdycudqeh/Build/Products/Debug-iphoneos/yooweiExtension.appex

○ Target 'yooweiExtension': ProcessProductPackaging  /Users/galahad/Library/Developer/Xcode/DerivedData/yoowei-drnrntneloepunakcqbcdycudqeh/Build/Intermediates.noindex/yoowei.build/Debug-iphoneos/yooweiExtension.build/yooweiExtension.appex.xcent

○ Target 'yooweiExtension' has target dependency on Target 'yoowei'

→ Target 'yoowei' has target dependency on Target 'yooweiExtension'

○ That command depends on command in Target 'yooweiExtension': script phase “[CP] Check Pods Manifest.lock”

对应的解决方案:选中项目target -> Build phase -> Target Dependencies  去掉相互的依赖即可

2)第二种方法 修改build system 
在Xcode菜单栏 -> File -> Workspace Setting,将build system修改为legacy build system,然后clean后编译。

2、典型问题

ld: library not found for -lstdc++.6.0.9

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

解决方案:(我一般升级xcode 之前都会将lib 给备份一份。具体路径是:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib )

1、提前在xcode 9中 根据路径   /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib 找到 libstdc++.6.0.9.tbd  备份

2、复制刚才的libstdc++.6.0.9.tbd 文件,手动添加到 升级后的xcode 10  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib 文件夹中,运行即可。

需要的话,可以找我要。注意分真机和模拟器环境:

1.真机环境:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/
2.模拟器环境:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/

20190313遇到一种情况:编译报错     library not found for -l"stdc++.6.0.9" 

比较奇怪就是,我已经按照上面将libstdc++.6.0.9.tbd 手动添加过了。但是为什么还会报错呢?

解决办法:

打开Build Phases--Link Binary With Libraries,删除6.0.9依赖   添加Libc++.tdb 即可。

如果依赖c++6.0.9的SDK是第三方SDK等待第三方更新解决。

最新文章

  1. Linux如何学习
  2. Quartz Scheduler(2.2.1) - Integration with Spring
  3. java异步任务处理
  4. UVA 540 Team Queue
  5. HashMap 的遍历key与value的方法
  6. [hadoop系列]Pig的安装和简单演示样例
  7. 输入n个数和输出调整后的n个数
  8. 投票项目-bootstrap
  9. maven下载jar包失败后无法再次重新下载
  10. springboot 注册服务注册中心(zk)的两种方式
  11. Jupyter Notebook中的快捷键
  12. MYSQL事务处理失效原因
  13. 前端自动化构建工具webpack (二)之css和插件加载总结
  14. k8s service网络
  15. 新建maven遇到的错误
  16. springboot+swagger2案例
  17. phpstudy升级mysql版本到5.7 ,重启mysql不启动
  18. Hyper-V 虚拟机连网
  19. TOJ2470
  20. (转)Python进阶:函数式编程(高阶函数,map,reduce,filter,sorted,返回函数,匿名函数,偏函数)

热门文章

  1. ddt 接口示范以及报告生成html案例
  2. iptables传输数据包的过程
  3. [NOI2001]炮兵阵地 【状压DP】
  4. C语言程序设计I—第十二周教学
  5. vbs获取当前主机IP
  6. weex中UISegmentControl实现及遇到的问题
  7. 【OC底层】Category、+load方法、+initialize方法原理
  8. 利用phar实行php反序列化命令执行(测试环境复现)
  9. 如何在mac上运行vue项目
  10. Kali-linux本地权限提升