2

I'm on Xcode 10.1. Whenever I 'pod install' anything on my current project, I get this

Command CompileSwift failed with a nonzero exit code

Because of that I'm not able to build anything or some useful 3rd party libraries. Did hours of digging and found out that many people were suffering off this bug.

Tried all the approach but none seem to work. Is this a common Xcode problem and when does this error occur. I have worked with pod on numerous occasion but never seen this error.

Appreciate the help.

Kaushik Makwana
  • 1,329
  • 2
  • 14
  • 24
user256419
  • 81
  • 2
  • 10
  • The same problem happened with me. I did find a strange solution (I think it is a solution), for some reason when I make the Xcode project title's name a bit shorter it seems to work (under 12 characters). Give this a try, for some reason it worked with me. – Cal Jan 14 '19 at 23:07
  • Possible duplicate of [Build fails with "Command failed with a nonzero exit code"](https://stackoverflow.com/questions/46690619/build-fails-with-command-failed-with-a-nonzero-exit-code) – Tamás Sengel Jan 15 '19 at 00:11
  • 1
    None of the solution works for me and I wanted to why this is happening. – user256419 Jan 15 '19 at 01:04
  • Please share a minimal Podfile that demonstrates the problem. – Paul Beusterien Jan 15 '19 at 02:15
  • Make sure you're using the `.xcworkspace` file and not the `.xcproject` file. – EmilioPelaez Jan 15 '19 at 07:11
  • @EmilioPelaez Thanks but I'm aware of .xcworkspace where Im suppose to work on once the pod is installed. – user256419 Jan 15 '19 at 15:49
  • @user256419 you should include all of that information in your question. We have no idea of your skill level, so all we can do is guess what could be going wrong. If you tell us everything you've tried (cleaning the project, using the workspace, etc.), we can try to suggest some things you haven't done. – EmilioPelaez Jan 15 '19 at 16:01

2 Answers2

-5

Open Keychain Access > Right click on Login > Lock >

Open Keychain Access > Right click on Login > Unlock

Clear Derived Data

Clear Bean folder

than restart Computer

Open project and run again

By the way i am From Surat,Gujarat,India >>> hahaha

vishvesh
  • 1
  • 1
-6

Ty to clean your project, steps:

hold SHIFT + Command + K

Then try to build your project again.

I'm assuming that after you install the pods, you had closed the project and opened the white workspace, if not you should do this first.

Pincha
  • 93
  • 1
  • 10
  • 3
    This was the first thing I did but it did nothing. It says build succeed and when I run the project I get the same problem of returns a nonzero exit code. – user256419 Jan 15 '19 at 15:47
  • This answer is on every question relating to this error and has dozens of people saying it does not work, not sure why it keeps getting posted – ricks Feb 09 '19 at 19:09
  • 2
    If anybody cares I solved this by manually pointing pods to specific swift version. For one of the pods, I needed to point to swift 4.0 namely 'TKImageShowing' library. Every other pods were satisfied with 4.2 as their swift version. This took me many permutation and nothing is properly documented on Xcode. That is why this confuse arose in first place. – user256419 Feb 11 '19 at 17:14