Unhandled Promise Rejection Warning

I have made an ionic project. It was previously working fine. But now 2 main things in this project are not working.

  1. splash screen is not showing
  2. API calls are working fine in “ionic serve” but aren’t working when I run that app on my phone, or any phone for that matter.

I tried removing the splash screen plugin and adding it again. While removing the plugin & adding it I get this error -

(node:13340) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token < in JSON at position 1701

I tried removing the Android platform and adding it again, but while doing that the same error pops up.

The platform is getting added to the platform folder but while doing it the above error shows. And I think it has some connection with the splash screen and API calls not working.

Can anyone help me with that?