DynamicColor icon indicating copy to clipboard operation
DynamicColor copied to clipboard

Carthage build fails for version 5.0.0

Open marioradonic opened this issue 5 years ago • 4 comments

I've been unsuccessfully trying to add this project as a Carthage dependency. In the console I get:

*** Building scheme "DynamicColor" in DynamicColorExample.xcodeproj
Build Failed
	Task failed with exit code 65:
   ...

And the file clearly prints out the error:

/Users/mario/Projects/tests/DCTest/Carthage/Checkouts/DynamicColor/Sources/SwiftUIColor.swift:30:18: error: use of undeclared type 'Color'
public extension Color {
                 ^~~~~

** ARCHIVE FAILED **


The following build commands failed:
	CompileSwift normal arm64
	CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
	CompileSwift normal armv7
(3 failures)

To Reproduce Steps to reproduce the behavior:

  1. Add github "yannickl/DynamicColor" >= 5.0.01 in Cartfile
  2. Run carthage bootstrap/update
  3. See error

Expected behavior A clear and concise description of what you expected to happen.

Smartphone (please complete the following information):

  • Carthage version: 0.34.0
  • MacOS: tried on Mojave and Catalina

Additional context I did try to debug the error, but I failed. The line in question is using the struct from SwiftUI, and it's enclosed with @available attribute, but still it somehow fails 🤷‍♂

marioradonic avatar Jan 27 '20 08:01 marioradonic

+1

robert4381 avatar Jan 27 '20 22:01 robert4381

Any update? It looks like the same error.

/Carthage/Checkouts/DynamicColor/Sources/SwiftUIColor.swift:27:8: error: no such module 'SwiftUI' import SwiftUI ^

** ARCHIVE FAILED **

The following build commands failed: CompileSwift normal armv7 CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler CompileSwift normal arm64

ladmini avatar Feb 06 '20 03:02 ladmini

In a release build, I get...

~/Dev/DynamicColor/Sources/SwiftUIColor.swift:30:18: error: use of undeclared type 'Color'
public extension Color {

My app deployment target is iOS 11, but Color is not available until iOS 13 — swift header with Xcode 11.3:

@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *)
public struct Color : Hashable, CustomStringConvertible {

I would guess Carthage build is just obscuring the underlying cause. (The project I am working on is using CocoaPods.)

t0rst avatar Feb 06 '20 14:02 t0rst

I submitted Issue #59: Broken release builds – misconfigured SwiftUI dependency — it's not a Carthage problem.

t0rst avatar Feb 07 '20 16:02 t0rst