Value for SWIFT_VERSION cannot be empty.

Hi All,


After installing xcode 11.4 (11E146) my Objective C project has the error "Value for SWIFT_VERSION cannot be empty"


Now I can`t build the project HELP

Try this:

- select the projet at very top of the file browser in XCode (the blue icon)

- select in Targets

- select Build settings

- search for Swift: you will find in Basic / Combine tags, the Swift version.

- set as needed

Hi Claude,


I tried this but I am building an Objective C Project so there is ni Swift setting to change ?

Look in PROJECT instead of TARGETS

In Basic - Combined, you should find Swift Language Version.


Note, I built a Swift project in XCode 11.4 on iOS 13.4 with Swift version unspecified, no problem…

Nothing there ???

When you select PROJECT:

- can you select Build Settings tab on the top line ?

- then can you select Basic Combine (thet are selected altogether) ?


Do you see ?

- Architectures

- Build Options

- Deployment

- Packaging

- Search Paths

- Signing

- Apple Clang - Code generation

- Apple Clang - Language

- Apple Clang - Language - C++

- Apple Clang - Language - Modules

- Apple Clang - Language - Objective C

- Apple Clang - Language - Preprocessing

- Apple CLang - several warning domains

- Static Analyzer - Generic issues

- Static Anamyzer - Issues - APIs

- Swift Compiler - Code Generation

- Swift Compiler - Custom Flages

- Swift Compiler - Language

Swift Language Version

- User Defined


The field is Swift Compiler - Language

Hi


After static Analyzer there is just user defined. This is an Objective C project there is NO Swift. (see pic below)

pic do not show on the forum.


You're right, I created a dummy project and there's no Swift entry.


have you third party libraries linked to it ?

You have to create the SWIFT_VERSION key…


Solution found here (for XCode 8, but should be the same for XCode 11):


https://stackoverflow.com/questions/43240035/xcode-8-3-swift-version-error-swift-version-in-objective-c-project

Thanks,


The problem was I put in core data to my project. The solution is here. stackoverflow.com/questions/38446097/…

Would the other solution have worked ?


Anyway, thanks for feedback, that was not a third party library, just a CoreData.


You should file a bug report so that the compiler warning be more explicit or for more appropritae CoreData setting when the project is created.


Don't forget to close the thread.

I am using XCode Version 11.4.1 (11E503a)


I have faced it. It may be a bug of XCode. Do the following to avoid this situation


1. Create new demo project (Objective C) with Core Data enabled

2. Drag and drop your newly created xcdatamodeld file to your existing framework project [with copy file if needed] , remove your previous model file first.

3. Run the project, problem vanished.

4. Now create entity and attributes in this model file


Thanks

Value for SWIFT_VERSION cannot be empty.
 
 
Q