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

Error with carthage update ChartsRealm fails to build #1326

Closed
lewissk opened this issue Aug 16, 2016 · 26 comments
Closed

Error with carthage update ChartsRealm fails to build #1326

lewissk opened this issue Aug 16, 2016 · 26 comments

Comments

@lewissk
Copy link

lewissk commented Aug 16, 2016

When running a carthage update --platform iOS ChartsRealm fails to build. I have tested this on 3 of our machines with the same result. We have cleaned the project deleted the Carthage directory tried downgrading the version. All with the same result.

Here is the output of the failure:

The following build commands failed:
Ld /Users/user/Library/Developer/Xcode/DerivedData/ChartsRealm-admcvrfsqdqvoxfzhmelrhhyzqfx/Build/Intermediates/Charts.build/Release-iphoneos/Charts-OSX.build/Objects-normal/armv7/Charts normal armv7
Ld /Users/user/Library/Developer/Xcode/DerivedData/ChartsRealm-admcvrfsqdqvoxfzhmelrhhyzqfx/Build/Intermediates/Charts.build/Release-iphoneos/Charts-OSX.build/Objects-normal/arm64/Charts normal arm64
(2 failures)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
A shell task (/usr/bin/xcrun xcodebuild -project .../Carthage/Checkouts/Charts/ChartsRealm/ChartsRealm.xcodeproj -scheme ChartsRealm-iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** BUILD FAILED **

The following build commands failed:
Ld /Users/user/Library/Developer/Xcode/DerivedData/ChartsRealm-admcvrfsqdqvoxfzhmelrhhyzqfx/Build/Intermediates/Charts.build/Release-iphoneos/Charts-OSX.build/Objects-normal/armv7/Charts normal armv7
Ld /Users/user/Library/Developer/Xcode/DerivedData/ChartsRealm-admcvrfsqdqvoxfzhmelrhhyzqfx/Build/Intermediates/Charts.build/Release-iphoneos/Charts-OSX.build/Objects-normal/arm64/Charts normal arm64
(2 failures)

@Cunqi
Copy link

Cunqi commented Aug 17, 2016

same here, get the same error

@calvingit
Copy link

If you don't need the ChartsRealm, go to Carthage\Checkouts\Charts, delete ChartsRealm, and run command carthage build.

@tomassliz
Copy link

@lewissk: I have the same issue if I try to run Carthage action with Fastlane. If I run carthage update --platform iOS or carthage update directly in terminal, everything is ok. Do you use Fastlane or not?

@lewissk
Copy link
Author

lewissk commented Aug 17, 2016

@tomassliz I am not using Fastlane although I really like Fastlane. I am just doing the basic commandline carthage update --platform iOS

@tomassliz
Copy link

@lewissk After a few attempts everything works. It doesn't matter if I'm using Fastlane or not. I don't know what was the problem because everything is still the same (I removed Carthage folder and hard reset my git repo every time)

@gunterhager
Copy link
Contributor

Same issue here. It fails only when building the iOS version of ChartsRealm. Seems like it wants to link Cocoa to the iOS framework which obviously won't work:

ld: framework not found Cocoa
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@kukushi
Copy link

kukushi commented Sep 7, 2016

Same issue here. Any follow up on this issue?

@danielgindi
Copy link
Collaborator

Update your Carthage... It seems that it chooses wrong build arguments. As Cocoa is only imported for OSX

@dbmrq
Copy link

dbmrq commented Sep 7, 2016

My carthage is up to date and I still have this problem. It should be fixed with #1119, I hope it happens soon.

@pmairoldi
Copy link
Collaborator

#1119 will not fix this issue. I was looking into this tonight and I think carthage gets confused about which charts.framework to use when building. It seems to pick up the first one available which is sometimes OS X which fails. I am going to try to make ChartsRealm depend on the carthage built charts.framework and see if that works.

@dbmrq
Copy link

dbmrq commented Sep 7, 2016

@petester42 Well, it won't fix it if you want to use ChartsRealm, but a lot of people (like me) don't and carthage still builds it just because it's in the same repo.

@pmairoldi
Copy link
Collaborator

Building all schemes in a project is a limitation of carthage. There is really nothing we can do about that. Having a different repo for each little extension becomes unmanageable really fast

@dbmrq
Copy link

dbmrq commented Sep 7, 2016

Well, I wouldn't call it a "little extension", and neither would many people at #1119, but ok then, we can agree to disagree.

@pmairoldi
Copy link
Collaborator

I would invite people having trouble with carthage builds to try using github "danielgindi/Charts" "extract-realm" in their Cartfile.

Please report back if it fixes the problems.

@dbmrq
Copy link

dbmrq commented Sep 7, 2016

@petester42 It still doesn't work here. :/

** BUILD FAILED **


The following build commands failed:
    CompileSwift normal arm64 /Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmLineRadarDataSet.swift
    CompileSwift normal arm64 /Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmPieDataSet.swift
    CompileSwift normal arm64 /Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmLineDataSet.swift
    CompileSwift normal arm64 /Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmScatterDataSet.swift
    CompileSwift normal arm64 /Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmBarDataSet.swift
    CompileSwift normal arm64 /Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmBaseDataSet.swift
    CompileSwift normal arm64 /Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmCandleDataSet.swift
    CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler
(8 failures)
/Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmLineRadarDataSet.swift:41:22: error: use of undeclared type 'Fill'
/Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmPieDataSet.swift:47:20: error: use of unresolved identifier 'PieChartDataEntry'
/Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmPieDataSet.swift:51:20: error: use of unresolved identifier 'PieChartDataEntry'
/Users/daniel/Documents/Code/ios/Leio/Carthage/Checkouts/ios-charts/ChartsRealm/Classes/Data/RealmLineDataSet.swift:153:33: error: use of undeclared type 'IFillFormatter'
# And so on...

@pmairoldi
Copy link
Collaborator

In what order did things build in?

@dbmrq
Copy link

dbmrq commented Sep 7, 2016

# carthage update --platform iOS ios-charts
*** Fetching ios-charts
# ...
*** Fetching realm-cocoa
*** Downloading realm-cocoa.framework binary at "v1.0.2"
*** Checking out ios-charts at "d9d73eb072cb60f2b841eb7dd0be59b0561d9f2b"
*** xcodebuild output can be found in /var/folders/p7/7ckwbkvs0wb3q2qpn7wjn4yh0000gn/T/carthage-xcodebuild.Ybt8ep.log
*** Building scheme "Charts-iOS" in Charts.xcodeproj
*** Building scheme "ChartsRealm-iOS" in ChartsRealm.xcodeproj

And then come the errors.

@pmairoldi
Copy link
Collaborator

I just tried it and it works just fine for me. Try deleting your derived data and then if that doesn't work delete the carthage folder as well as the cartfile.resolved.

screen shot 2016-09-07 at 9 49 39 pm
screen shot 2016-09-07 at 10 02 03 pm

@ephread
Copy link

ephread commented Sep 8, 2016

I have the exact same issue @dbmrq encountered. I've cleaned everything, from the Derived Data to the CarthageKit cache before attempting a new build. The full log is available here, and my Cartfile looks like this:

github "realm/realm-cocoa" ~> 1.0
github "danielgindi/Charts" "extract-realm"

Nothing out of the ordinary. :)

@pmairoldi
Copy link
Collaborator

From the logs that submitted it seems like you maybe are using a different version of xcode to build since those seem like generic syntax failures. Try running xcode-select -print-path and see if your path is 7.3.1.

@ephread
Copy link

ephread commented Sep 8, 2016

I just checked, the path points to the regular Xcode package, not the beta one.

Interestingly, building the frameworks on its own, after a failed attempt by Carthage, works flawlessly (assuming Carthage was able to build Charts and Realm).

I runned the command that Carthage supposedly used:

$ /usr/bin/xcrun xcodebuild -project '<project>/Carthage/Checkouts/Charts/ChartsRealm/ChartsRealm.xcodeproj' -scheme ChartsRealm-iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build

It might actually be a weird timing issue, coming from Carthage.

@dbmrq
Copy link

dbmrq commented Sep 9, 2016

I tried it with your new workspacing branch and now it seems to be working! 🎉

@pmairoldi
Copy link
Collaborator

🔥🔥🔥

@ephread
Copy link

ephread commented Sep 9, 2016

Using workspacing, it's working for me as well! 👏

@kristijanexads
Copy link

kristijanexads commented Sep 14, 2016

My solution was removing github "danielgindi/Charts" ~> 2.2.5 from the Cartfile and run carthage update --platform iOS to build all other frameworks, and after that run carthage update separately for Charts with carthage update Charts --platform iOS

@pmairoldi
Copy link
Collaborator

closed by #1422

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