Hi Rui, thanks for reaching out us.
With regard to your question there are a few things to note:
/Applications is a folder which requires elevated permission to write in: I recommend to move the SDK in a different location where standard user permission are required;
with R21, whether you're using Xcode 10.1 or further revision, it's supposed that you enable the
Legacy Build System in the Project Settings: be sure to set it via File -> Project Settings in Xcode.
Finally it's recommended, when such building issues are faced, to provide a description of your development environment.
Cheers, R