Very experienced Delphi developer, but I’m new to cross-platform with FMX. Help!
Under Delphi 10.4.2, I can start a brand new FMX project, and without any additions or changes it will compile (and build and run) just fine with Windows as a target. But when I switch my Target Platform to MacOS-64>Normal and try to compile, the compile fails. My PAServer is running, and the Connection Profile appears to be accepted just fine, and XCode is running.
Compile dialog says, "Failed / There are errors. / Errors: 1"
The Messages window isn’t very helpful either:
Checking project dependencies…
Compiling Project2.dproj (Debug, OSX64)
That isn’t much to go on! Any suggestions, please?
I was suspicious about the choice offered for SDK at the start of the Compile step, and checking further I found a path setting that needed to be changed for Xcode over on the Mac side. Buried down in the SDK Manager documentation is a section "Handling Multiple Xcode Installations", and that got my attention because I do indeed have two Xcode installs. The doc says, "If you have more than one installation of Xcode, you must make sure that the xcode-select command-line tool points to your main Xcode installation folder."
So, on the Mac at the Terminal prompt, type this:
The path it shows as a result should be your desired Xcode install, such as this:
When I tried this, it pointed instead into the /Library/ directory! The fix is to set the correct path. At the Terminal prompt, enter this:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
On my Mac, the names of my Xcode apps include the version numbers, so the name should be surrounded by single quotes, e.g., ‘Xcode 11.3.1’
Success can be confirmed by doing
again. With that correction, the compile on Delphi now offers the correct SDK, and the compile, build, and run on the Mac all work just fine.
Of course, it would have been simpler if the compiler had provided a better message than just "Error" and "Failed".