Compatibility between Xcode 12.3 and Xcode 12.0.1

By updating Xcode to version 12.3, the same source code that compiled with Xcode 12.0.1, no longer compiles with Xcode 12.3.

Is it correct to have to change the code or is it an anomaly?

Below is the scenario and the details of the errors.

We tested in two different machines:

  1. MacOs Catalina machine

(10.15.7) with Xcode 12.3 and IPhoneOS SDK 14.3 - MacMini 8,1 2018 - Intel i7 6 Core 3.2 Ghz - 64 GB RAM

  1. MacOs BigSur machine

(11.6) with Xcode 12.0.1 and IPhoneOS SDK 14.0 - MacMini 8.1 2018 - Intel i7 6 Core 3.2 Ghz - 64 GB RAM

In the first machine, we had an error relating to a swift object “CardData.swift”:

/System/Volumes/Data/a/1/I/Model/PlannedOperations/CardData.swift:72:13: error: initializer for conditional binding must have Optional type, not 'String'

            let pan = card.pan ?? "",

            ^ ~~~~~~~~~~~~~~

 

By checking the GYM logs, this type of error occurs on the first component built.

 

Here is the command used by GYM for the first build:

//xcodebuild -workspace ./xyz.xcworkspace -scheme ABC_UAT -derivedDataPath / System / Volumes / Data / a / 1 / DerivedData -destination generic / platform = iOS -archivePath " //file.xcarchive "clean archive" CODE_SIGN_IDENTITY = iPhone Distribution: Company_name "  

In the second machine, we had no errors.  

Here is the command used by GYM for the second build:

//xcodebuild -workspace ./xyz.xcworkspace -scheme ABC_UAT -derivedDataPath / System / Volumes / Data / a / 5 / DerivedData -destination generic / platform = iOS -archivePath " //file.xcarchive "clean archive" CODE_SIGN_IDENTITY = iPhone Distribution: Company_name "  

Can anyone help us understand what happened?

 

Thanks

      let pan = card.pan ?? "",

Could you show how you defined card ? If it is a class or a struct which has a var pan, it should be declared as:

var pan: String?

It could be that 12.3 is more strict on some type checking than 12.0

One possibility is that your code was wrong even in Xcode 12.0.1, but the Swift compiler could not detect the faults in your code. Pleas show enough code to see what is happening.

Compatibility between Xcode 12.3 and Xcode 12.0.1
 
 
Q