0

I faced to pretty ugly thing with xCode 6.3 and Swift 1.2

I have existing project started in xCode 5. It uses Swift since it was released (Swift Beta 1). Now I need to be able to produce App Store and Test Flight updates, but I can't do that with xCode 6.3. I'm able to launch project for debug on any simulator or device, this issue appears only during archiving.

I've converted all my Swift code to Swift 1.2, no issues. I didn't use the Edit->Convert->To Latest Swift Syntax tool, I did it manually. Now when I'm trying to launch Convert tool it says that my code is good, no updates are required.

Now I have: Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

I can see that error happens right after bridging header processing is done: enter image description here

Our whole team have same issue during archiving, so I assume that this is not related to my particular Mac. I tried Clean, delete Derived Data and restart everything. Also tried to setup all possible Swift Optimization levels. Same issue even with -Onone. I even tried to resetup (delete and create a new one) Bridging Header manually.

Could anyone provide any help, cause I feel myself pretty stuck here. Thanks

iiFreeman
  • 5,165
  • 2
  • 29
  • 42
  • Try to build & run with Release mode to your iDevice. Just to know if in Release mode, the compilation works well or not. – Duyen-Hoa Apr 10 '15 at 14:22
  • @iiFreeman did you find a fix? i am having the same issue... – Amitay Apr 16 '15 at 10:07
  • @Amitay I fixed this very strange way and I'm afraid I;m not able to explain how exactly. Switch "Command line tool" couple of time, switching optimization level one by one, set different deployment targets, clean and delete derived data, restart xCode, restart machine... I don't have a recipe. After one of my mac reboots it's suddenly started to archiving the project. I noticed that I had 6 Optimization levels available in Build Settings. Then is suddenly changed to 3 as it appears on the screenshot bellow and it started to archive – iiFreeman Apr 16 '15 at 16:37

2 Answers2

4

Have you changed Command Line Tools to XCode 6.3?

enter image description here

Also, there are some peoples have solved this problem by changing the Optimization level to None in Release. Try with this solution. I'm not sure if it can do something for you or not. By default, Optimization Level for Debug = None, Release = Fastest. When you archive your project, XCode use normally Release mode.

enter image description here

Duyen-Hoa
  • 15,384
  • 5
  • 35
  • 44
1

Seems like the problem is when you have an old project with some subprojects under source control while the main one is not.

I have removed from Xcode Preferences source control completely, and it seems did the trick - now archiving works.

To remove your project from Source Control press command+, (or select Preferences from main menu) -> Source Control and uncheck all parameters.

I am following this issue in the developer forums and seems like Apple is aware of the issues.

New projects are not affected.

Answered from Xcode 6.3: Crash while archiving a project

Shefali Soni
  • 1,234
  • 14
  • 26