Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with Carthage and Xcode 12 GM #141

Closed
jadar opened this issue Sep 16, 2020 · 7 comments
Closed

Build fails with Carthage and Xcode 12 GM #141

jadar opened this issue Sep 16, 2020 · 7 comments

Comments

@jadar
Copy link

jadar commented Sep 16, 2020

I'm attempting to build the latest version of the framework using Carthage and Xcode 12 GM. It seems that it builds correctly in the example project, but when I do it through Carthage, it fails. I can't figure out why, though. It claims it can't find the SwiftUI symbols, but that cannot be the case if it builds in the example project.

❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:35:37: cannot find type 'Context' in scope

    public func makeUIView(context: Context) -> UIViewType {
                                    ^~~~~~~



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:42:61: cannot find type 'Context' in scope

    public func updateUIView(_ uiView: UIViewType, context: Context) {
                                                            ^~~~~~~



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:12:29: cannot find type 'UIViewRepresentable' in scope

public struct MorphingText: UIViewRepresentable {
                            ^~~~~~~~~~~~~~~~~~~



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:55:31: cannot find type 'View' in scope

    static var previews: some View {
                              ^~~~



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:62:9: unknown attribute 'State'

        @State var morphingEnabled = true
        ^



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:63:9: unknown attribute 'State'

        @State var textIndex: Double = 0
        ^



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:64:9: unknown attribute 'State'

        @State var effectIndex: Double = 0
        ^



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:84:31: cannot find type 'View' in scope

        public var body: some View {
                              ^~~~



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:61:28: cannot find type 'View' in scope

    struct PreviewWrapper: View {
                           ^~~~



❌  /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabel/SwiftUI/MorphingText.swift:53:31: cannot find type 'PreviewProvider' in scope

struct MorphingText_Previews: PreviewProvider {
                              ^~~~~~~~~~~~~~~


** ARCHIVE FAILED **


The following build commands failed:
	CompileSwift normal armv7
	CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler
	CompileSwift normal arm64
(3 failures)
Build Failed
	Task failed with exit code 65:
	/usr/bin/xcrun xcodebuild -project /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel/LTMorphingLabelDemo.xcodeproj -scheme LTMorphingLabel -configuration Release -derivedDataPath /Users/AAA/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7208/LTMorphingLabel/0.8.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/s7/m7sqymqs5klgpfl8fk9_ps1h0000gn/T/LTMorphingLabel SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/AAA/Development/BBB/CCC/Carthage/Checkouts/LTMorphingLabel)

This usually indicates that project itself failed to compile.
@jadar
Copy link
Author

jadar commented Sep 17, 2020

Just an update, I was able to reproduce in the example project. When I tried to preview the SwiftUI part, it would fail to compile. For some reason, it doesn't want to optionally build the SwiftUI pieces when the minimum target OS is iOS 8. Setting it to 12 seemed to resolve the issues I was having with building.

@lexrus
Copy link
Owner

lexrus commented Sep 20, 2020

Fixed in the latest release. Sorry for the inconvenience.
https://github.com/lexrus/LTMorphingLabel/releases/tag/0.9.2

@lexrus lexrus closed this as completed Sep 20, 2020
@jadar
Copy link
Author

jadar commented Sep 21, 2020

Thank you, so much!!!

@jadar
Copy link
Author

jadar commented Sep 21, 2020

Okay, I am building with --no-use-binaries because there's currently an issue with Carthage building different platforms and lipo. I think you'll have to upload a build that uses this workaround for it to work in Xcode 12. Carthage/Carthage#3019

@lexrus
Copy link
Owner

lexrus commented Sep 23, 2020

Cool, I'll have a try late tonight.

@lexrus lexrus reopened this Sep 23, 2020
@lexrus lexrus pinned this issue Sep 24, 2020
@lexrus
Copy link
Owner

lexrus commented Sep 24, 2020

I guess we should wait for the upcoming Carthage fix. For now I'll leave this issue open and pinned at the top.
For any one who face this issue, please use the workaround script mentioned in that issue: Carthage/Carthage#3019
You can also use my prebuilt releases.

@lexrus
Copy link
Owner

lexrus commented May 30, 2021

https://github.com/Carthage/Carthage#building-platform-independent-xcframeworks-xcode-12-and-above
Hey, I'd like to close this issue since Carthage recommends building xcframework instead.
Feel free to reopen it if you face any further problem.

@lexrus lexrus closed this as completed May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants