Search code examples
iosxcodenext.jscapacitor

"Failed to resolve host network app id to config" Error on Deployed URL in Xcode Build


Question:
I am using Capacitor with Next.js to convert my web app into a mobile app. The integration works fine when I configure capacitor.config.ts as follows:

server: {
  url: 'http://MY_IP:PORT',
  cleartext: true,
}

This setup points to my local development server, and everything works as expected.

However, when I update the url to the deployed version of my web app, e.g.:

server: {
  url: 'https://mydeployedapp.com',
  cleartext: false,
}

...the build fails in Xcode with the error:

"Failed to resolve host network app id to config"

The mobile app also renders a 500 status code after the failure.

Has anyone encountered this issue or knows how to properly configure Capacitor for production deployment? Any suggestions on resolving this would be greatly appreciated!

P/s: Perhaps from missing config in Info.plist?

Thank you!


Solution

  • After 2 days, I found that the problem came from firebase config because of mismatch bundle id. It's quite annoying due to not logging correctly