How can I suppress warning that "Conversion to Swift 5 is available"?

After upgrading to Xcode 13.2 I receive a warning that "Conversion to Swift 5 is available". If I click the warning then a target conversion window appears allowing me to select which targets should be migrated.

My project uses a large number of Swift packages and this list contains 76 targets. 73 of these targets are from packages that target swift-tools-version: 5 or newer. The other 3 packages have swift-tools-version set to 4.x. Unfortunately these are open-source packages that I cannot change.

If I try to run the migration it stops with an error that the project could not be built, with no additional information. This is incorrect as the project and all dependencies build fine.

The warning is not removed if I click "Convert Later", even if "Remind Me" is unchecked.

The Swift compiler version for the top-level Xcode project is set to 5. I don't understand why I'm getting this warning as it did not appear with Xcode 13.0 or 13.1.

Is there a way to suppress this warning? We have a zero warning policy for our projects so I need to resolve or suppress this warning, at least for the current Xcode version (13.x).

Post not yet marked as solved Up vote post of simonw Down vote post of simonw
7.6k views

Replies

why I'm getting this warning as it did not appear with Xcode 13.0 or 13.1.

Probably because Xcode has implemented new checks in 13.2.

To confirm, could you tell what are the elements the warnings ask to update ?

Here a recent history of Swift versions in Xcode

Version History

  • Date            Swift       Xcode
  • 13 Dec 21    5.5.2         13.2
  • 25 Oct 21    5.5.1          13.1
  • 20 Sep 21    5.5            13.0

The ways I know to suppress such warning:

  • accept it (usually the best)
  • selectively suppress some warnings

Select Target -> select Build settings search as Warnings Change the Selected warnings to NO by selecting the dropdown. However, I don't know if the warning you want to suppress is in the list (could not find it). https://stackoverflow.com/questions/37023700/how-to-hide-warnings-in-xcode

  • revert to an older version of Xcode
  • and finally adapt your company policy.

You can also filter them (but that will not remove).

  • As I mentioned above, Xcode is suggesting to migrate all 76 Swift package dependencies, regardless of whether they target Swift 5 or not.

    These are Swift packages, so there are no build settings as one finds in a traditional Xcode project. The only option available is to specify the target Swift tool chain version, which is set to Swift 5 for all but 3 dependencies.

Add a Comment

It's a bug in Xcode 13. It'll list the "Conversion to Swift 5 is available" for all Swift Packages, regardless of the package being written in Swift 5 or not.

  • Thanks for the info. We look forward to Apple fixing this issue in a future version of Xcode.

  • This has been driving me crazy (well, it's not actually a "drive," per se. More of a short putt -Ed.) for weeks.

Add a Comment

Also experiencing this issue. Xcode 13.1 does not have this warning. Xcode 13.2 does. When the conversion process is ran it does not make any changes.

I ran into the same problem. Xcode 13.3 (Beta 1) als presents this warning.

The same issue has existed when using cocoapods for a long time as far as i can tell, the workaround (since Apple never bothered fixing it) was to have a post-install fix/script in the Podfile that overwrote the target version for each pod. If the issue persist in the next versions (Xcode 13.3 still has it) maybe we could make something alike for SPM.

Same issue here in Xcode 13.3.1. Anyone found a way to disable it yet?

For me its coming from a dependency of a dependency of a dependency. I've tried reaching out to see can they be updated but some haven't been touched in ~3 years. I won't hold my breath that it will get done.

Also opened a bug for Xcode with the feedback assistant. Anyone who hasn't done so, please do it to make sure it gets looked at

Facing the same issue in Xcode 13.4.1. Did anyone find a way to disable it yet?

Alamofire is on swift5 version, my project target has swift5 version, and test target has swift5 version. still, it shows "Conversion to Swift 5 is available"

  • please create a ticket using: https://feedbackassistant.apple.com/ (if you haven't already) to try and nudge this along. I have one created and it says "less than 10 similar reports". Need more people to complain about it ti get it fixed

Add a Comment

Very disappointing that this is still the case in XCode 14! Surely a lot of developers are now using SPM...

  • Create a ticket using: https://feedbackassistant.apple.com/ (if you haven't already) to try and nudge this along. I have one created and it says "less than 10 similar reports". Need more people to complain about it ti get it fixed

Add a Comment

I am seeing this with Xcode 14 as well, and accepting the upgrade reports no changes necessary, but it doesn't dismiss the warning 😩

  • please create a ticket using: https://feedbackassistant.apple.com/ (if you haven't already) to try and nudge this along. I have one created and it says "less than 10 similar reports". Need more people to complain about it to get it fixed

Add a Comment

This warning is still happening in XCode 14.0.1 and it is so frustrating! Is this affecting everyone who uses SPM? I don't understand why this is still broken and has been for so long?

Still happening on Xcode 14.1