Xcode 10 convert to Swift 4.2 fails

Viewed 10788

I am getting this error trying to migrate to Swift 4.2 using the Xcode provided conversion tool. How do I fix it? The code builds fine otherwise.

enter image description here

5 Answers

Do you have any libraries in your project? I think you are trying to covert your project with dependencies and there are problems in them with new swift version. Try to uncheck all dependencies except your project and convert to new version of Swift

I had similar problem, solved it by

1- Change swift lang version in build setting of all app and test targets to 4.2

2- build app, errors will happen like UIControlState renamed to UIControl.state

3- fix all of the build errors

4- I updated all recommended settings by xcode

5- then I asked xcode to convert to swift4.2

updated all recommended settings

It's always a good idea to upgrade all dependencies (e.g. via Cocoapods) to its latest version that support Swift 4.2. In my case, I also need to manually change the Swift Language Version build settings for a pod library from Swift 4 to Swift 4.2 as that lib uses some APIs in 4.2 only.

I have problem too. I find solution to fix this problem in web https://ericasadun.com/2018/09/13/converting-projects-by-hand-to-4-2/

First

You try delete pod in pod file and install pod again and pod update in your folder project in command then conversion to Swift 4.2. if it's not work do this in second.

Second

you try follow do this picture in build setting project or try follow do in link web.

enter image description here

enter image description here

As described here,

There may have been issues with processing the targets that will negatively impact the migration process. Switch to the Report Navigator and select the Convert entry that was added; this is the conversion build log. Check the log for errors that may have showed up.

If you see errors about not being able to code-sign the target, try disabling code-signing from the build settings of the target. If you see other errors, please file a bug report and include the details. You are strongly encouraged to attach a project that illustrates the faulty migration if possible.

Related