When a new version of Xcode comes out, invariably there is only one SDK for iOS and macOS included. As is Apple’s way, sometimes they change something in the new SDK that breaks the SDK import in Delphi. This article describes a couple of solutions for it.
The problem
The typical scenario is: you start a completely new install of Delphi, either because you’re a new user, or you like to start a new installation with a new version. You install Xcode on the Mac (or already have), and you go to import the SDK in Delphi, using Tools|Options, Deployment > SDK Manager.
At the time of writing, the latest released version of Xcode is 11.6. In Delphi’s SDK Manager you go to import the iOS SDK, and the only SDK available is iOS 13.6. You select that, import the SDK, then attempt to compile an iOS application. Unfortunately you are greeted with:
ld: file not found: /usr/lib/system/libcache.dylib for architecture arm64 [DCC Fatal Error] F2588 Linker error code: 1 ($00000001)
This is because Apple have changed what is distributed with the iOS 13.6 SDK. In the SDK folder (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.SDK). The /usr/lib/system folder underneath simply does not exist. (I will update later as to why this is, since I am yet to find out).
So what can you do about this? If you have access to an installation of Delphi where the iOS 13.x SDK (preferably iOS 13.5) had been imported, the solution may be relatively trivial.
Solution 1
By default, SDKs are imported into C:\Users\[username]\Documents\Embarcadero\Studio\SDKs (where [username] is the login name for that computer.) You could:
- Copy the iPhoneOS13.5.sdk folder from the SDKs folder on wherever the other Delphi installation is, to corresponding folder of the machine of your new installation
- Export the HKEY_CURRENT_USER\Software\Embarcadero\BDS\21.0\PlatformSDKs\iPhoneOS13.5.sdk (21.0 = Delphi 10.4) registry key from that machine, and import it into the registry of the new installation
Solution 2
Only if you’re unable to use Solution 1 (hint: another developer may be able to help you out), you may consider downloading an older version of Xcode so that you can obtain the older SDK. Older versions of Xcode can be downloaded from here. (you may need to sign in). You could:
- Download Xcode 11.5, and extract it somewhere on your Mac, other than in the Applications folder where the current version is.
- Open a Terminal window on the Mac (/Applications/Utilities/Terminal), and enter the following:
sudo xcode-select -s [path]/Xcode.app
Where [path] is the path where you extracted the older version to.
- In Delphi, you should now be able to import the iOS 13.5 SDK. Once you have, you can execute the following command to switch Xcode back to the default:
sudo xcode-select -r
Alternatively, you could not execute this command and work with Xcode 11.5 being active for as long as is practicable.
macOS SDKs
The above solutions may well work similarly for macOS SDKs if you’re stuck in the same situation.
just installed delphi 10.4 and got a macbook air to run xcode. I followed your previous post and installed 10.3 component. Any device I choose in the simulator target running iOS10.3 will launch on the Macbook but the apps I install do not run. I checked the SDK version and it is 13.6. So I installed Xcode 11.5 and imported SDK 13.5 but still no app will run in the simulator. Suggestions?
iOS simulator is yet to be supported in the newer versions of Delphi. It is planned for one of the 10.4.x releases.
Hello Dave,
do you know whether Embarcadero will make an adjustment in the near future?
As it stands, it currently doesn’t seem to be possible to connect the newly released IOS 14.0 SDK with Delphi:
[DCC Fehler] E2597 ld: file ‘…\SDKs\iPhoneOS14.0.sdk/usr/lib/libiconv.dylib’ too small (length=0) for architecture arm64
[DCC Fataler Fehler] F2588 Linker-Fehlercode: 1 ($00000001)
Almost all files in the directory “\usr\lib” and “\usr\lib\system” are 0kb in size after the import.
Hi Prem, I certainly hope there is a fix, soon
@Prem iOS 14 is working with XCode 11.7
You might want to clarify exactly what you mean. Xcode 11.7 does not have the iOS 14 SDK (it comes with Xcode 12.x). Do you mean that you can use a device that has iOS 14 when using Xcode 11.7? Debugging/launching still won’t work (presently) with a device that has iOS 14, regardless of Xcode version.
Perfect Dave. Its help so much! thank u from Brazil