When I build a debug version of my app and tested it on my android phone, the API's I am using didn't connected to it but when I tested the HTML code itself (with the API's) on my pc (not in cordova, in my browser) it worked just fine. I am using cordova-android 10.1.1 and 30.0.3 as my android build tools sdk version. The API I am using is a simple weather API from WeatherApi.Com. I am using it by the fetch function in js and gets the output to a div. An example code :
<div id="weather">Loading...</div>
<script>
fetch("the api url")
.then((response) => {response.json()})
.then((data) => {
document.getElementById("weather").innerHTML = data.weather;
})
</script>
With this code, the div stays on "Loading..." forever.
I am not using any plugin, and I just removed the css and the js from the default index.html file I got in the www folder.
Is there a solution for this issue?
I tried to build a debug version of my app and check if everything is ok with the API before building the release and everything was fine in my chrome browser, but when I tested it on my android mobile phone it didn't worked.