4

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.

meltonCG
  • 119
  • 1
  • 11
  • https://stackoverflow.com/questions/46338588/xcode-9-swift-language-version-swift-version may be it will help check once – narasimha Dec 11 '17 at 04:45
  • Possible duplicate of [Xcode 9 Swift Language Version (SWIFT\_VERSION)](https://stackoverflow.com/questions/46338588/xcode-9-swift-language-version-swift-version) – Antony Raphel Dec 11 '17 at 09:07
  • I have looked at these threads, however I have an objective-c project and do not have the options they say to change to resolve this issue. – meltonCG Dec 11 '17 at 10:52

2 Answers2

6

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

cmlloyd
  • 975
  • 9
  • 14
4

For Objective C Projects created using Xcode 8 and now opening in Xcode 9, it is showing the same error as mentioned in the question.

To fix that, Press the + button in Build Settings and select Add User-Defined Setting.

Then in the new row created add SWIFT_VERSION as key and 3.2 as value like below.

It will fix the error for objective c projects.

meltonCG
  • 119
  • 1
  • 11