As mentioned earlier, it is important to note that Xcode 9 or later is required on macOS 10.12.4 or higher for all this to work properly. Xcode is available from Apple on Mac App Store for free.
First things first, download the latest version of Xcode from Mac App Store and then install it on your Mac.