Fix of Qt Kit for iOS with Xcode 12


Quick fix to prevent issues of Qt Kit for iOS with Xcode 12

02/10/2020

From Xcode 12 you should come across a very big problem that causes a compiling error and even a wrong behavior during the reading of the Qt project.

Waiting for an official solution by Qt, this is a quick guide to fix the issue.

Go to ios/mkspecs/features/toolchain.prf in the qt kit folder you are using.

In the lines 185 – 189 you will find cxx_flags for darwing os; add the argument –arch $$QMAKE_APPLE_DEVICE_ARCHS.

The result will be like this:

darwin {

uikit:macx-xcode:

cxx_flags += -isysroot $$sdk_path_device.value -arch $$QMAKE_APPLE_DEVICE_ARCHS

else:

cxx_flags += -isysroot $$QMAKE_MAC_SDK_PATH -arch $$QMAKE_APPLE_DEVICE_ARCHS

}

Reload the project in Qt Creator.