Well this exit code 1 error can appear due to various number of issues . Original error is something else .
I would need the whole error log to check this issue .
Last time we also faced that exit code 1 error it was due to facebook plugin of cordova .
Please try this solution :
remove cordova facebook4 pluign by running this command in your command console :
cordova plugin rm cordova-plugin-facebook4
then add facebook plugin again bu running this command :
ionic cordova plugin add [email protected] --variable APP_ID= --variable APP_NAME=
dont forget to put your app id from facebook and app name on facebook .
and then try building your app. Let me know if this works .