I found the answer to this with the help of Eric Tieniber from Mendix.
In the phone gap build package there is an folder called config and in that folder an environments.json file. In my case the url value was set to the url value as shown in the developer portal (https://xxxxxx-accp.mendixcloud.com value) instead of the custom domain value (https://xxxxxx-a.mycustomdomain.com). Changing the url to the custom domain value resolved the issue.
Thanks Eric!!