5

A project that compiles fine in Xcode 11 beta 3, cannot compile in beta 4 with errors in the pods:

<unknown>:0: error: unknown argument: '-Wno-shorten-64-to-32'
Command CompileSwiftSources failed with a nonzero exit code

The pod in question is Down, a Markdown library in Swift.

This is very similar to this other SO question but with a different "unknown argument":

error: unknown argument: '-Wno-shorten-64-to-32'

Any suggestions?

WPK
  • 392
  • 3
  • 10
  • Running into this too. I made an issue on the Down repo: https://github.com/iwasrobbed/Down/issues/162 – michaelgmcd Jul 20 '19 at 15:11
  • 1
    Possible duplicate of [Xcode 11 beta 4 error: Command CompileSwiftSources failed with a nonzero exit code](https://stackoverflow.com/questions/57085119/xcode-11-beta-4-error-command-compileswiftsources-failed-with-a-nonzero-exit-co) – iwasrobbed Jul 23 '19 at 23:42
  • 1
    Not a duplicate of that error; this issue still happens in the version of Cocoapods released to fix that issue. – Mike Glass Jul 24 '19 at 17:09

3 Answers3

1

Commenting out this line in the Down.podspec file:

spec.compiler_flags = '-Wno-shorten-64-to-32' 

worked for me, at least for now. No promises that there aren't any side effects though. I have a local version of the pod for various reasons, so this was fairly simple for me to do; your results may vary, but it will get you up and running again for the time being.

Mike Glass
  • 106
  • 2
  • 5
  • I have this exact problem, in Down no less, but can't find a Down.podspec file anywhere, nor can finder find a file containing no-shorten-64-to-32. I'm attempting to port a project over to the beta compiler, and am at my wits end trying to figure out where this is coming from. Any further ideas? – Feldur Jul 23 '19 at 20:39
  • The podspec file is part of what makes it work with cocoapods; you'd have to have a complete local version of the pod. In my case, I have my own fork and made the modification in my own copy of the podspec. I haven't tried this, but I guess you could grab a copy of the podspec from [here](https://raw.githubusercontent.com/iwasrobbed/Down/master/Down.podspec) and update your podfile to reference it: [https://guides.cocoapods.org/syntax/podfile.html#podspec](https://guides.cocoapods.org/syntax/podfile.html#podspec) – Mike Glass Jul 24 '19 at 17:08
1

For the benefit of anyone else coming across this discussion, take a look at this CocoaPods thread. It turns out that there's a problem with CocoaPods passing flags to Swift that are not acceptable, and the beta 4 compiler now rejects such flags while the previous one did not. In the case of Down, the -Wno-shorten-64-to-32 flag is OK for the Objective-C compiler, but not Swift. Down could fix this in the near term by taking out the

spec.compiler_flags = '-Wno-shorten-64-to-32' 

line, as Mike Glass has suggested here, but in the longer run CocoaPods will have to permit separating compiler flags between different compilers followed by a corresponding Down update if required to match whatever new podspec syntax the CocoaPods fix requires.

Feldur
  • 1,121
  • 9
  • 23
0

Faced the issue in Xcode 11.3. Done everything related to derived data clear, pod remove and everything available on internet but no luck and the app was not debugging on real device. Then thought that it could be the issue of Xcode crash, just removed the Xcode to trash and cleared the trash and then reinstalled the fresh copy of Xcode 11.3. It worked for me, thanks to my assumption.