Cocoapods: Command line Build Job Failure In Xcode 10 Beta

Created on 20 Jun 2018  ·  28Comments  ·  Source: CocoaPods/CocoaPods

Tested with Cocoa Pods Version - 1.5.3
Xcode Version - 10.0beta

Build Product Path - ${SRCROOT}/../build
Building pods Project Fails with Xcode 10 command Line tools

For e.g(Build Command) - xcodebuild build -project Pods/Pods.xcodeproj -alltargets -sdk iphonesimulator12.0
Error -:
error: Build input files cannot be found: ‘/Users/test/Documents/Code/TestBetaJenkins/Pods/../build/Pods.build/Release-iphonesimulator/CtxCrashUploaderLib.build/Objects-normal/i386/CtxCrashUploaderLib.LinkFileList’, ‘/Users/test/Documents/Code/TestBetaJenkins/build/Pods.build/Release-iphonesimulator/CtxCrashUploaderLib.build/Objects-normal/i386/CtxCrashNetworkingOperation.o’, ‘/Users/test/Documents/Code/TestBetaJenkins/build/Pods.build/Release-iphonesimulator/CtxCrashUploaderLib.build/Objects-normal/i386/CtxCrashUploadOperation.o’,

* BUILD FAILED *

The following build commands failed:
Libtool /Users/test/Documents/Code/TestBetaJenkins/build/Pods.build/Release-iphonesimulator/CtxCrashUploaderLib.build/Objects-normal/x86_64/libCtxCrashUploaderLib.a normal x86_64
Libtool /Users/test/Documents/Code/TestBetaJenkins/build/Pods.build/Release-iphonesimulator/CtxCrashUploaderLib.build/Objects-normal/i386/libCtxCrashUploaderLib.a normal i386
(2 failures)

Note -:

Same Build Command works in Xcode 9.
Build Succeeds even if I change Build Product path From “${SRCROOT}/../build” to “../build” manually in Xcode 10.

new build system

Most helpful comment

@foldericon You can use the old build system from the File -> Workspace Settings... window.

All 28 comments

Can you please upload a sample app demonstrating the issue? It is nearly impossible for us to diagnose such issues as CocoaPods issues or just user error issues.

Sorry I cannot help with the given information.

I have the same issue and it happens with every single project that I tried that uses cocoapods.
Probably related to fusion drive since it's working fine on my MBP. At first I thought It's Mojave causing the issue but I repartitioned and restored from time machine (high sierra) and the issues are still there. Also updating to Xcode 10 beta 2 doesn't solve anything. I heard that apple introduced a new build system in Xcode 10. Isn't there a way to use the old build system somehow?

@foldericon You can use the old build system from the File -> Workspace Settings... window.

IceCreamShop_Final-1.zip

Please Find the Uploaded Sample Project.
And It happens with every single project.
Please Run the below command by setting command line tools as XCode 10
“xcodebuild build -project Pods/Pods.xcodeproj -alltargets -sdk iphonesimulator12.0”

Even changing BuildSystem doesn't work for me.

I am able to compile this with Xcode 10 Beta 1 but within the UI and using new build system. I cant compile from command line but I also don't get the same error as you do. I think it might be my own mistake.

This is an error we are getting from our sample project when running from command line.

Ditto /Users/vivek/Documents/Code/Libraries/XCode\ 10\ beta/IceCreamShop_Final\ 2/build/Pods.build/Release-iphonesimulator/Alamofire.build/module.modulemap /Users/vivek/Documents/Code/Libraries/XCode\ 10\ beta/IceCreamShop_Final\ 2/build/Release-iphonesimulator/Alamofire/Alamofire.framework/Modules/module.modulemap (in target: Alamofire)
cd /Users/vivek/Documents/Code/Libraries/XCode\ 10\ beta/IceCreamShop_Final\ 2/Pods
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/vivek/Documents/Code/Libraries/XCode\ 10\ beta/IceCreamShop_Final\ 2/build/Pods.build/Release-iphonesimulator/Alamofire.build/module.modulemap /Users/vivek/Documents/Code/Libraries/XCode\ 10\ beta/IceCreamShop_Final\ 2/build/Release-iphonesimulator/Alamofire/Alamofire.framework/Modules

* BUILD FAILED *

The following build commands failed:
Ld /Users/vivek/Documents/Code/Libraries/XCode\ 10\ beta/IceCreamShop_Final\ 2/build/Pods.build/Release-iphonesimulator/Alamofire.build/Objects-normal/x86_64/Alamofire normal x86_64
Ld /Users/vivek/Documents/Code/Libraries/XCode\ 10\ beta/IceCreamShop_Final\ 2/build/Pods.build/Release-iphonesimulator/Alamofire.build/Objects-normal/i386/Alamofire normal i386
(2 failures)

Building it from UI is fine. We are facing this issue only from command Line.
Even Building Workspace works fine from Command Line.It fails only when I run Pods project from command Line

Sorry I am not sure what the issue is. My best advice is to try to create a small project that does not use CocoaPods and see if you get the same error from the command line. If you do then its an Xcode 10 issue.

I tried it with the small sample project, it is working fine there. We are facing this only with pods project and that too from Xcode 10 beta command Line.
This is not the issue with our project. I am facing this issue with every project which has cocoa pods installed.

@shyamjimishra1993 I believe you. I am only saying that it would be nice to narrow this down further and figure out the problem for others. I might give it a shot again when I find free time.

That is weird because I had this issue when building using the GUI. I haven't tried with the command line yet but I will do this weekend.

Hello dnkoutso,
Even I am facing this issue when running pods project from Xcode 10 beta command line tools. I am struck with this from around 10 days researching about this error, But couldn't find anything. Would be great if you can help us in resolving this issue. I need to solve it asap

Note:- Same build command works with Xcode 9

hey I am also facing the same issue. Would it be possible to get this resolved this sooner than later?

Hello dnkoutso,
Can you help us out with this issue? Have you tried it?
Tried in all possible ways, Don't understand what is the issue. Need to fix it asap. Any help would be appreciated.
Thank you.

Switching to legacy build system fixed it for me.
Now I can build using both, GUI and command line via xcodebuild.

Can you reproduce the error with the new build system in xcode 9?

Hi Guys,

Need some help here.
I am not able to run my pods project even with legacy build system.Not only with my project, even I tried with other sample projects I am facing the same issue.

Any help would be appreciated.Thank you

@dnkoutso I have another project you can use to try to reproduce the issue: cocoapods-rome-xcode-10-toolchain-problem-demo, there's an issue opened in CocoaPods/Rome#70 which I suspect is related to this.

@lecksfrawen I tried to reproduce this with the new build system and Xcode 9 but I couldn't, it works. Although I'm not sure that I did the right thing, as cocoapods-rome doesn't generate a workspace and I changed the build system setting in the client project.

@Ruenzuo Even I tired of solving this ...
tried all possible ways - only way to make it work is --
Build Succeeds even if I change Build Product path From “${SRCROOT}/../build” to “../build” manually in Xcode 10.

But this will reset every time I run pod install from cmd.

I don't understand what is the issue, whether it is issue of Xcode 10 cmd line tools or Cocoapods.
I strongly believe it is a cocoa pods issue. Any help would be appreciated.

It works as expected in Xcode 9 .
It fails only in Xcode 10 in both new build system and legacy build system

@vivekhumnabad thanks for pointing that out! I can confirm that changing the value of SYMROOT to "../build" fixes the issue, but I don't understand why. Something like this: https://github.com/CocoaPods/CocoaPods/compare/master...Ruenzuo:update_symroot

I verified the values of both SYMROOT and SRCROOT with shell script build phases using the two different build systems and nothing is different, so I can't really explain what's happening.

The demo project I shared before with the fix applied: Ruenzuo/cocoapods-rome-xcode-10-toolchain-problem-demo#apply_fix

@dnkoutso any ideas?

You can try opening the generated Pods.xcodeproj and setting its build system to the old one.

You can do so by going (in Xcode) to File > Project Settings and then setting the Build System to "Legacy Build System".

Then, try running your project from the .xcworkspace again.
Does that resolve the issue?

That being said, this might also get overwritten if you do a pod install; I haven't checked this.

Bas Thomas
Already tried changing it to legacy build system, even that didn't help

Guys,
Issue is resolved in Xcode 10 beta 6.

Thanks

Yes, this indeed seems to be fixed by beta 6.

Very nice! @Ruenzuo can you also confirm? Then I close.

@dnkoutso yes, this can be closed 👍

excellent!

Hi can I know the command line for xcodebuild to use legacy build system?
thanks

Hey @LayMuiToh — what's the issue you're running into? CocoaPods should work with either build systems. Maybe open a new issue describing your problem?

Was this page helpful?
0 / 5 - 0 ratings