xcode 将 swift 更新到 4.0 版后,迦太基构建失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46362724/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Carthage Build Failed after updating swift to version 4.0
提问by poqw
Carthage build failed after updating swift to version 4.0 from version 3.2.
Here are the results of using the carthage update --platform iOS
.
将 swift 从 3.2 版更新到 4.0 版后,Carthage 构建失败。以下是使用carthage update --platform iOS
.
*** Fetching AlamofireImage
*** Fetching FSCalendar
*** Fetching Alamofire
*** Fetching ActiveLabel.swift
*** Fetching Toaster
*** Fetching PopupDialog
*** Fetching DKImagePickerController
*** Checking out DKImagePickerController at "3.6.1"
*** Checking out PopupDialog at "0.5.4"
*** Checking out Toaster at "2.1.0"
*** Checking out ActiveLabel.swift at "0.8.0"
*** Checking out Alamofire at "4.5.1"
*** Checking out FSCalendar at "2.7.9"
*** Checking out AlamofireImage at "3.3.0"
*** xcodebuild output can be found in /var/folders/6z/c0myz1fn4rsgy842p9vqqr700000gn/T/carthage-xcodebuild.my2Am1.log
*** Building scheme "ActiveLabel" in ActiveLabel.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/poqw/Documents/GitHub/nyg-ios/Carthage/Checkouts/ActiveLabel.swift/ActiveLabel.xcodeproj -scheme ActiveLabel -configuration Release -derivedDataPath /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Users/poqw/Documents/GitHub/nyg-ios/Carthage/Checkouts/ActiveLabel.swift)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/6z/c0myz1fn4rsgy842p9vqqr700000gn/T/carthage-xcodebuild.my2Am1.log
And then $ tail /var/folders/6z/c0myz1fn4rsgy842p9vqqr700000gn/T/carthage-xcodebuild.my2Am1.log
进而 $ tail /var/folders/6z/c0myz1fn4rsgy842p9vqqr700000gn/T/carthage-xcodebuild.my2Am1.log
I got this :
我懂了 :
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:~/.local/bin:/usr/local/bin:/Users/poqw/miniconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/opt/local/bin"
/usr/bin/ditto -rsrc /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/Objects-normal/armv7/ActiveLabel.swiftdoc /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Products/Release-iphoneos/ActiveLabel.framework/Modules/ActiveLabel.swiftmodule/arm.swiftdoc
** BUILD FAILED **
The following build commands failed:
CompileC /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/Objects-normal/armv7/ActiveLabel_vers.o /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/DerivedSources/ActiveLabel_vers.c normal armv7 c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/Objects-normal/arm64/ActiveLabel_vers.o /Users/poqw/Library/Caches/org.carthage.CarthageKit/DerivedData/9.0_9A235/ActiveLabel.swift/0.8.0/Build/Intermediates.noindex/ActiveLabel.build/Release-iphoneos/ActiveLabel.build/DerivedSources/ActiveLabel_vers.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
And Here is What I have done for fix this problem.
这是我为解决此问题所做的工作。
- Delete derived Carthage Cache.
- Delete Carthage directory in project.
- Uninstall Carthage and install again.
- Download Xcode 8.3.2 and
xcode-select --switch /Applications/Xcode8.app/Contents/Developer
and use thexcrun
command to make sure that the version has been changed to swift 3.0 and then update Carthage. - Clean Project and rebuild
- Restart Xcode
- 删除派生的迦太基缓存。
- 删除项目中的 Carthage 目录。
- 卸载 Carthage 并重新安装。
- 下载 Xcode 8.3.2 并
xcode-select --switch /Applications/Xcode8.app/Contents/Developer
使用xcrun
命令确保版本已更改为 swift 3.0,然后更新 Carthage。 - 清理项目并重建
- 重启Xcode
I would appreciate if anyone can help me.
如果有人可以帮助我,我将不胜感激。
回答by Mac Senour
I'm using Xcode 8.3.1 and this is what I followed:
我正在使用 Xcode 8.3.1,这就是我所遵循的:
Deleted derived data.
Removed Carthage folder: rm -r ./Carthage
Updated Cartfile with:
github "facebook/facebook-sdk-swift" "master"
github "facebook/facebook-ios-sdk" "sdk-version-4.21.0"
Run Carthage command:
运行迦太基命令:
carthage update --platform iOS --no-use-binaries
回答by dobranoc
Mac Senour's solution didn't work for me; what worked was cleaning derived data of CarthageKit here: /Library/Caches/org.carthage.CarthageKit/DerivedData/
Mac Senour 的解决方案对我不起作用;有效的是在这里清理 CarthageKit 的派生数据:/Library/Caches/org.carthage.CarthageKit/DerivedData/