1. 程式人生 > >升級xcode10.0後,編譯原有正常工程遇到的坑

升級xcode10.0後,編譯原有正常工程遇到的坑

一大早上看到可以升級xcode10,心情美美噠。然而升級完,開始編譯原有正常工程,卻報錯了。

提示有重複的檔案。

問題1:

  • Multiple commands produce '/Users/wmh/Library/Developer/Xcode/DerivedData/GS_Mobile-dsuqtvptcdfuyyfqjtnevxwiayup/Build/Products/Debug-iphonesimulator/GS_Mobile.app/Info.plist':
  • 1) Target 'GS_Mobile' (project 'GS_Mobile') has copy command from '/Users/wmh/Project/GSYD_XinJiang/GS_Mobile/Tools/FSCalendar/Info.plist' to '/Users/wmh/Library/Developer/Xcode/DerivedData/GS_Mobile-dsuqtvptcdfuyyfqjtnevxwiayup/Build/Products/Debug-iphonesimulator/GS_Mobile.app/Info.plist'
  • 2) Target 'GS_Mobile' (project 'GS_Mobile') has copy command from '/Users/wmh/Project/GSYD_XinJiang/GS_Mobile/Tools/MJExtension/Info.plist' to '/Users/wmh/Library/Developer/Xcode/DerivedData/GS_Mobile-dsuqtvptcdfuyyfqjtnevxwiayup/Build/Products/Debug-iphonesimulator/GS_Mobile.app/Info.plist'
  • 3) Target 'GS_Mobile' (project 'GS_Mobile') has process command with output '/Users/wmh/Library/Developer/Xcode/DerivedData/GS_Mobile-dsuqtvptcdfuyyfqjtnevxwiayup/Build/Products/Debug-iphonesimulator/GS_Mobile.app/Info.plist'

問題2

  • Multiple commands produce '/Users/wmh/Library/Developer/Xcode/DerivedData/GS_Mobile-dsuqtvptcdfuyyfqjtnevxwiayup/Build/Products/Debug-iphonesimulator/GS_Mobile.app/jquery-1.9.1.min.js':
  • 1) Target 'GS_Mobile' (project 'GS_Mobile') has copy command from '/Users/wmh/Project/GSYD_XinJiang/GS_Mobile/Class/Apply/mailhelp/jquery-1.9.1.min.js' to '/Users/wmh/Library/Developer/Xcode/DerivedData/GS_Mobile-dsuqtvptcdfuyyfqjtnevxwiayup/Build/Products/Debug-iphonesimulator/GS_Mobile.app/jquery-1.9.1.min.js'
  • 2) Target 'GS_Mobile' (project 'GS_Mobile') has copy command from '/Users/wmh/Project/GSYD_XinJiang/GS_Mobile/Tools/library/help1/jquery-1.9.1.min.js' to '/Users/wmh/Library/Developer/Xcode/DerivedData/GS_Mobile-dsuqtvptcdfuyyfqjtnevxwiayup/Build/Products/Debug-iphonesimulator/GS_Mobile.app/jquery-1.9.1.min.js'  

報錯原因:重複,由於重複檔案是其他部門有依賴,所以有兩種解決方案

方案1--> 修改了xcode的配置暫時解決了編譯報錯的問題。

xcode--file--project settings--Build System--legacy Build System

再次編譯,提示,遇到問題

library not found for -l"stdc++.6.0.9"

原因:Xcode10取消了6.0.9的支援,但是在xcode9上面可以找到,

解決辦法:

(開啟Build Phases--Link Binary With Libraries,刪除6.0.9依賴 )

如果依賴c++6.0.9的SDK是第三方SDK,需要聯絡第三方,等待第三方更新

如果是自己的檔案引用了c++,請替換對c++庫的使用,重新編譯

方案2--->  1,選擇開啟所在的專案Target ----> Build Phases ---->Copy Bundle Resources  ;2,刪除報錯的那些檔案,