29

I'm having issues with archiving on my CI machine (Jenkins), when running the process manually on the SAME machine but with the Xcode UI, everything works just fine.

The error I get is:

<unknown>:0: error: cannot have input files with file list

** 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
(4 failures)

The original command it's executing on failure is VERY long (68K+ characters), here it is stripped down from all pods/app info:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift @/var/folders/cc/h3hp1kt14rv3j5t_lybwwgqh0000gp/T/arguments-ece6e3.resp # -frontend -c -filelist /var/folders/cc/h3hp1kt14rv3j5t_lybwwgqh0000gp/T/sources-e4a704 -supplementary-output-file-map /var/folders/cc/h3hp1kt14rv3j5t_lybwwgqh0000gp/T/supplementaryOutputs-4e5601 -target arm64-apple-ios10.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk  -g -module-cache-path / ... /ModuleCache.noindex -swift-version 4 -O -D RELEASE -serialize-debugging-options ...  -module-name APPNAME -num-threads 8 -output-filelist /var/folders/cc/h3hp1kt14rv3j5t_lybwwgqh0000gp/T/outputs-3df91d

Some more info:

  1. Using Cocoapods 1.5.3 (also reproduces with latest 1.6.0_beta.1)
  2. Using the "Legacy Build System"
  3. the exact command I'm running to archive is: xcodebuild -scheme APPSCHEME -workspace APPNAME.xcworkspace -configuration Release clean build archive -derivedDataPath "../build" -archivePath "../build/APPNAME.xcarchive"

Just to make things even more interesting, when running the archive command on my local machine I see no failures... VERY strange and inconsistent.

Any help will be appreciated!

Adi B.
  • 369
  • 1
  • 3
  • 10
  • 1
    Facing same issue any help appreciated ! – Swift Nov 19 '18 at 05:39
  • Ld /Users/buildadmin/Library/Developer/Xcode/DerivedData/Project Name-cztdvnrjawdhuyflibgzdhwgttze/Build/Intermediates.noindex/ArchiveIntermediates/Project Name/IntermediateBuildFilesPath/Project Name.build/Release-iphoneos/Project Name.build/Objects-normal/armv7/Project Name normal armv7 archive failed. – Swift Nov 19 '18 at 05:57
  • Try to post some more log lines before the ** ARCHIVE FAILED ** line. Usually over there it says if it couldn't find specific files or what so ever – denis_lor Feb 13 '19 at 09:06
  • Me too facing same issue with Jenkins. Any help could be appreciated. – kalyan711987 Mar 07 '19 at 07:37
  • check your `export` for me `unset CPATH` worked – ale_stro Oct 10 '19 at 11:52

5 Answers5

22

A related case in which this error appears is by running:

xcodebuild -scheme sharetec build

In my case I just had to tune up a little more the parameters like this:

xcodebuild -workspace [WP_NAME].xcworkspace -scheme [A_TARGET] -sdk iphoneos clean build

So the error disappears.

chuckSaldana
  • 1,187
  • 12
  • 28
4

Eventually I figured it out, it's something that looks really UNRELATED, and yet it was the only thing that fixed the described issue for me.

Go to your build settings and remove any recursive search paths you have there. That's it. (any search path that ends with ** is a recursive one).

Good luck!

Adi B.
  • 369
  • 1
  • 3
  • 10
  • 4
    I faced the same problem you described. But there are no recursive paths in my project build settings. – Yulia May 27 '19 at 08:07
  • Thanks! Yep, it works well now. Jenkins+fastlane CI has been working normally for 2 years. A few days ago, it failed! Error info:"CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler", "failed to import bridging header", "/Objects-normal/arm64/your_project_name.swiftmodule", but archiving can work to use fastlane command line or manual in Xcode without jenkins! So, I guess there are some conflicts about jenkins and project configuration. – Tonin Jul 22 '19 at 10:57
  • Went to Build Settings and deleted what appeared to be an Objective-C bridging header, or at least one of them. Got into this situation by importing files into a project when Github pushes screwed me by not including the damn xcproject file in the pushes. – John Pitts Jun 25 '20 at 06:44
0

I had this issue when using AppCenter. I had selected a different version of xcode to that of my project's deployment target.

Shumii
  • 4,529
  • 5
  • 32
  • 41
0

I had the same issue doing:

xcodebuild -workspace ABC.xcworkspace -scheme SCHEME_NAME archive -archivePath ABC.xcarchive

I solved it by stripping out the -archivePath and its parameter.

Sebastian Juarez
  • 3,317
  • 2
  • 21
  • 20
0

I have a possible general solution for this issue. In my case, I followed all the advices from all the possible websites, including this one, but it was no luck until I tried archiving the project on Xcode itself (I was archiving thru fastlane, and its logs didn't help me at all). When I archived in Xcode, it actually showed me where was the problem, and I was able to quickly solve the issue. So, in case nothing works, try archiving in Xcode itself if you happen to archive outside of it.