Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode stuck on Generating Previews when Migrating to Swift 3

Xcode is stuck Generating Previews after trying to migrate my project from Swift 2.3 to Swift 3.

Is there anyway to check the status of this process without cancelling?

I'm using Cocoapods and I've already changed all of the Swift pods to Swift 3 versions.

Generating preview

like image 614
Cody Winton Avatar asked Sep 23 '16 21:09

Cody Winton


3 Answers

For people that are still stuck at "Generating Preview". Check if you have any class names defined that clashes with the (new) public api in Swift 3.

E.g. I had an 'Error.swift' class, which I had to rename. Since all 'NS' prefixes are being removed, this would cause the converter to keep running without providing us an error message.

like image 171
Thomas Neuteboom Avatar answered Nov 16 '22 11:11

Thomas Neuteboom


There is a workaround for this problem with which you can at least complete the process and start working on migration.

  1. Select targets to convert as usual

  2. Wait until the converter gets stuck

  3. Open Activity Monitor and kill the swift process

  4. Now the converter will continue and finish the work.

like image 34
Tolgahan Arıkan Avatar answered Nov 16 '22 11:11

Tolgahan Arıkan


Running migration from the command line worked for me. Try using this script:

https://gist.github.com/davidahouse/18dd78bef7ae543117c396f8c950ccfe

like image 1
Ned Avatar answered Nov 16 '22 11:11

Ned