mchoe / SwiftSVG

A simple, performant, and lightweight SVG parser
Other
1.92k stars 229 forks source link

Carthage build failed for macOS with Xcode 10.2.1 #131

Open zyqhi opened 5 years ago

zyqhi commented 5 years ago

My Cartfile:

github "mchoe/SwiftSVG" ~> 2.0

Command used to build framework:

carthage update --platform macOS

Than, I get the error, here is the log:

SwiftSVG.build/Release/SwiftSVG.build/Objects-normal/x86_64/PathDLexer.o -o /Users/mutsu/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2.1_10E1001/SwiftSVG/v2.3.0/Build/Intermediates.noindex/ArchiveIntermediates/SwiftSVG/IntermediateBuildFilesPath/SwiftSVG.build/Release/SwiftSVG.build/Objects-normal/x86_64/SVGLine.o -o /Users/mutsu/Library/Caches/org.carthage.CarthageKit/DerivedData/10.2.1_10E1001/SwiftSVG/v2.3.0/Build/Intermediates.noindex/ArchiveIntermediates/SwiftSVG/IntermediateBuildFilesPath/SwiftSVG.build/Release/SwiftSVG.build/Objects-normal/x86_64/SVGPolygon.o
/Users/mutsu/project/apple/macOS/SVGExplore/Carthage/Checkouts/SwiftSVG/SwiftSVG/SVG Extensions/SVGLayer.swift:90:35: error: 'archivedData(withRootObject:)' is only available on OS X 10.11 or newer
        let tmp = NSKeyedArchiver.archivedData(withRootObject: self)
                                  ^
/Users/mutsu/project/apple/macOS/SVGExplore/Carthage/Checkouts/SwiftSVG/SwiftSVG/SVG Extensions/SVGLayer.swift:90:35: note: add 'if #available' version check
        let tmp = NSKeyedArchiver.archivedData(withRootObject: self)
                                  ^
/Users/mutsu/project/apple/macOS/SVGExplore/Carthage/Checkouts/SwiftSVG/SwiftSVG/SVG Extensions/SVGLayer.swift:89:9: note: add @available attribute to enclosing property
    var svgLayerCopy: SVGLayer? {
        ^
/Users/mutsu/project/apple/macOS/SVGExplore/Carthage/Checkouts/SwiftSVG/SwiftSVG/SVG Extensions/SVGLayer.swift:84:8: note: add @available attribute to enclosing extension
public extension SVGLayer {
       ^
/Users/mutsu/project/apple/macOS/SVGExplore/Carthage/Checkouts/SwiftSVG/SwiftSVG/NSBezierPath+CrossPlatform.swift:42:17: warning: switch covers known cases, but 'NSBezierPath.ElementType' may have additional unknown values, possibly added in future versions
                switch type {
                ^
/Users/mutsu/project/apple/macOS/SVGExplore/Carthage/Checkouts/SwiftSVG/SwiftSVG/NSBezierPath+CrossPlatform.swift:42:17: note: handle unknown values using "@unknown default"
                switch type {
                ^

** ARCHIVE FAILED **

The following build commands failed:
    CompileSwift normal x86_64
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(2 failures)
bikram990 commented 4 years ago

This is a Xcode 10.2.1 header files bug. In documentation Apple says NSKeyedArchiver.archivedData(withRootObject: _) is available from OSX 10.2 onward but Xcode header files have wrong markings indicating that this was introduced in OS X 10.11.

Update: This was fixed in Xcode 10.3.