35

I've downloaded the latest Xcode beta 4. When I build I'm getting the same error with 3 of my pods:

Command CompileSwiftSources failed with a nonzero exit code
<unknown>:0: error: unknown argument: '-w'
<unknown>:0: error: unknown argument: '-Xanalyzer'
<unknown>:0: error: unknown argument: '-analyzer-disable-all-checks'

This is the MarqueeLabel pod logs: enter image description here

I have tried:

  • Cleaning and deep cleaning (shift + alt + cmd + k)
  • Deleting the Derived Data folder
  • Restarting Xcode

I can't see the error listed in the release notes. https://developer.apple.com/documentation/xcode_release_notes/xcode_11_beta_4_release_notes

Does anyone know what the problem is or a workaround?

Daniel Ryan
  • 6,976
  • 5
  • 45
  • 62

4 Answers4

32

There is a known issue with Cocoapods and Xcode 11 Beta 4 where inhibit_all_warnings! causes arguments to be set for Swift which do not compile. Removing this inhibit resolves the issue, and Swift warnings can be inhibited with SWIFT_SUPPRESS_WARNINGS = YES on targets instead.

garrettmurray
  • 3,338
  • 1
  • 25
  • 23
  • The `inhibit_all_warnings!` issue was fixed in CocoaPods 1.7.5, but there are other issues introduced by Xcode 11 beta 4 regarding pods with a podspec that specifies a `compiler_flags`. – Cœur Jul 25 '19 at 08:57
20

CocoaPods had a fix for this that got released as part of CocoaPods 1.7.5.


Below is the answer preceding the 1.7.5 release:

If you need to use Xcode 11 Beta 4 in the mean time, you could install a patched version of CocoaPods from that pull request:

1. Open Gemfile, replace gem 'cocoapods' with

gem 'cocoapods', :git => 'https://github.com/dnkoutso/CocoaPods.git', :branch => "swift_compiler_warnings"

2. Run bundle install and bundle exec pod install

Keep in mind, this is a temporary solution.

Cœur
  • 37,241
  • 25
  • 195
  • 267
pingwinator
  • 999
  • 7
  • 8
7

The latest version of CocoaPods (1.7.5) has this issue fixed!

  1. In Terminal run

    sudo gem update cocoapods

  2. And then, on your project directory

    pod install

Community
  • 1
  • 1
EBDOKUM
  • 1,696
  • 3
  • 15
  • 33
  • :0: error: unknown argument: '-w' still exist – ArisRS Jul 22 '19 at 08:38
  • Any thoughts as to why this might not be working? I created a new iOS project, pod init, add Down as a pod, pod install, and it fails. Verified on 1.7.5. – Feldur Jul 23 '19 at 23:52
  • Looks like the Down pod is having issues: https://stackoverflow.com/questions/57089656/xcode-11-beta-4-build-error-command-compileswiftsources-failed-with-a-nonzero – Daniel Ryan Jul 24 '19 at 22:31
-1

Resolved for me!!!!

The issue is actually i created two files with same name. So after i renamed one of a file and error cleared.