升級Xcode10問題集
問題1、錯誤資訊如下:
Showing All Messages:-1: Cycle inside WeexEros; building could produce unreliable results. This usually can be resolved by moving the shell script phase 'h' so that it runs before the build phase that depends on its outputs.Cycle details:→ That command depends on command in Target 'WeexEros': script phase “[CP] Copy Pods Resources”○ That command depends on command in Target 'WeexEros': script phase “[CP] Copy Pods Resources”
錯誤原因:
Xcode 10 預設使用的build system是New build system,與Xcode9不同。
解決方法:
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 → yooweiExtensionCycle 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後編譯。

xcode示意圖
問題2、 library not found for -lstdc++.6.0.9
ld: library not found for -lstdc++.6.0.9clang: error: linker command failed with exit code 1 (use -v to see invocation)
錯誤原因:
Xcode10中已去除這個library。專案中有用到的話,可以從舊版本Xcode中copy一份過來。
解決方法:
舊版本Xcode /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib
路徑下copy一份libstdc++.6.0.9.tbd,放到Xcode10對應目錄下。
另外提供附件 ofollow,noindex">下載地址
問題3、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移動到列表末尾,問題解決。