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

Carthage often fails build- with a random xcodebuild error #1325

Closed
danielgindi opened this Issue May 30, 2016 · 13 comments

Comments

Projects
None yet
6 participants
@danielgindi

danielgindi commented May 30, 2016

  • carthage version: 0.16.2
  • xcodebuild -version: 7.3
  • Are you using --no-build? No
  • Are you using --no-use-binaries? No
  • Are you using --use-submodules? No

Carthage Output

** BUILD FAILED **

A shell task (/usr/bin/xcrun xcodebuild -project /Users/dcg/Desktop/git/ios-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/dcg/Library/Developer/Xcode/DerivedData/ChartsRealm-awkviyhwwiusraefxhcbyfgemped/Build/Intermediates/Charts.build/Release-iphoneos/Charts-OSX.build/Objects-normal/arm64/Charts normal arm64
        Ld /Users/dcg/Library/Developer/Xcode/DerivedData/ChartsRealm-awkviyhwwiusraefxhcbyfgemped/Build/Intermediates/Charts.build/Release-iphoneos/Charts-OSX.build/Objects-normal/armv7/Charts normal armv7
(2 failures)

And always- when taking the xcodebuild command from the log and running it - it succeeds.
Doing it again - it succeeds.
Running carthage - Fails again.
The log - always contains a random error. Not the same error...

@mdiep

This comment has been minimized.

Member

mdiep commented May 30, 2016

What's in the xcodebuild log?

@danielgindi

This comment has been minimized.

danielgindi commented May 31, 2016

Sometimes "Cocoa framework not found" (when it's irrelevant, defined away in a multi-platform definition file), sometimes it's complaints about minimum deployment target of tvOS being too low, not matching a dependency (wrong), sometimes it's just random compilation errors about files that compiled just fine a minute ago.

But I can't stress this enough: When running the same xcodebuild command manually (copy-paste from the log) into the terminal, it runs fine!
It does not matter if I run it once, twice, or 10 times - it will run fine manually all of the times.
But when running Carthage, it will randomly fail, and not always on the same scheme.

@mdiep

This comment has been minimized.

Member

mdiep commented May 31, 2016

sometimes it's complaints about minimum deployment target of tvOS being too low

Are you trying to build for tvOS? Or are you trying to build for iOS?

I've had Xcode get confused when building iOS projects through a workspace—where the dependencies are included as Xcode projects. Sometimes it seems to choose the wrong platform for implicit dependencies, in which case you need to switch to using explicit dependencies.

Do you have a Cartfile that you can share? Can you share the full output from running carthage?

@danielgindi

This comment has been minimized.

danielgindi commented May 31, 2016

It's a project with multiple targets, for iOS, tvOS, and OSX.
https://github.com/danielgindi/Charts

The only thing the Cartfile contains is:
github "facebook/ios-snapshot-test-case" ~> 2.1

I've made some efforts to assist Carthage, by raising minimum deployment target and other adjustments, but the same still happens.

What I did eventually is uncheck the "Shared" on most schemes, achieve a successful Carthage build, then check some other ones. If Carthage fails for one- run it again. Until it has built all of them, and then call archive.

The weird thing is that if I collect the xcodebuild commands and run them consecutively it runs just fine with no errors...
Maybe sometiming issue, maybe it takes Xcode some time to clear the cache between builds.
In one of the logs I've seen it confuse a dependency (another project in the workspace) and use the wrong target, OSX, for a tvOS build, when running right after successfully building the OSX target. And failing of course because of "Cocoa framework not found".

I'm not sure if it's appropriate to paste the log files here as they are huge...

@micbuchanantlc

This comment has been minimized.

micbuchanantlc commented Oct 25, 2016

Hi Daniel,
I'm getting the same error, funnily enough trying to build your iOS-Charts with Carthage in XCode 8. No problems with Code Signing anywhere else. Any clues about the issue?:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/*********/Carthage/Checkouts/Charts/Charts.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 72:
xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH

Thanks by the way for what seems like a great library! ... If I can access it!-)

@ikesyo

This comment has been minimized.

Member

ikesyo commented Dec 9, 2016

Is this still happening?

@danielgindi

This comment has been minimized.

danielgindi commented Dec 11, 2016

Well we don't know, we've moved away from Carthage since every other version causes trouble with builds. We've spent too much time trying to make it work...
And since Apple recommends against pre-built binaries now until ABI compatibility is ready, there's not much point in this (for the moment)

@adamgit

This comment has been minimized.

adamgit commented Jan 9, 2017

Same problem here, I found the cause: massive bug in Xcode.

If you ever install a second version of Xcode, Xcode internally disables the command-line tools.

They are still there. You can use them from any command-line. They work perfectly. But ... xcode claims they are missing, because it's scared that you might want to use the old version of the new version.

You have to go into Xcode preferences, go to "Locations" tab, and you'll find the command-line tools dropdown has been wiped, with a note saying "none selected". Select anything, and ... problem goes away.

@ikesyo

This comment has been minimized.

Member

ikesyo commented Mar 5, 2017

The following should be the answer:

Sometimes it seems to choose the wrong platform for implicit dependencies, in which case you need to switch to using explicit dependencies.

Closing.

@ikesyo ikesyo closed this Mar 5, 2017

@adamgit

This comment has been minimized.

adamgit commented Mar 5, 2017

@ikesyo I don't see how that would affect the cause of these error messages that I ran into, but maybe there's more than one issue here?

@ikesyo

This comment has been minimized.

Member

ikesyo commented Mar 5, 2017

I was not answering to you, but to the original issue.

@ikesyo

This comment has been minimized.

Member

ikesyo commented Mar 5, 2017

@adamgit I think that the issue you had is separate one and that is really Xcode problem, not tied to Carthage itself.

@jp26jp

This comment has been minimized.

jp26jp commented Apr 20, 2017

Sometimes it seems to choose the wrong platform for implicit dependencies, in which case you need to switch to using explicit dependencies.

You do this like this:

carthage update --platform ios

ios isn't mandatory, just one of the arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment