Hi everyone,
I encounter something annoying, I have a small app i want to build on an Android Device.
Using this on browser (ionic serve) or livereload (ionic capacitor run android -l --external) it works fine but when i build directly with Gradle or generating an APK. This is not working at all.
var headersA = new HttpHeaders;
headersA.append("Accept", 'application/json');
headersA.append("Access-Control-Allow-Origin", "*")
const httpOptions = {
headers: headersA
};
this.http.put('http://192.168.1.250/api/ebx/x8r/4259840?', data, httpOptions).subscribe(d => () => { })
Adding these modifications didn’t work as well:
<application
android:networkSecurityConfig="@xml/network_security_config"
...
or creating a network_security_config.xml with
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">192.168.1.250</domain>
</domain-config>
</network-security-config>
Did someone encountered the same problem or is there any quick fix for that ?