Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The “Swift Language Version” (SWIFT_VERSION) build setting error with project in Objective C

So i just went to build my app after adding in core data to update my app to store and fetch some information and i got this error. (I am using XCode 9.2)

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.

Now whats confusing me is this in an Objective C app and surely the swift version shouldn't matter. I have browsed some threads on here stating that i need to update build setting to Swift 3.0 or to set values to Yes then back to No, however i have none of these fields when i search for Swift in the search bar.

buildSettings

Is this just a bizarre bug or have i mistakenly added some swift code?

Any ideas would help, thanks.

like image 840
meltonCG Avatar asked Dec 24 '22 11:12

meltonCG


1 Answers

I experienced this exact same issue after adding Core Data to an Objective-C framework I was working on.

I discovered that the reason I was getting the "Swift Language Version" warning was that the Code Generation language in the .xcdatamodel defaulted to Swift. Once I changed this back to Objective-C, the warning went away.

You can find this property in the File Inspector when you have the .xcdatamodel selected in the Project Navigator.

enter image description here

like image 110
cmlloyd Avatar answered May 27 '23 13:05

cmlloyd