I was working on an application in which I use a remote server for queries to my remote database. So far, everything is perfect. The application is finished and works correctly. However, when I migrate the project to another PC, the following exception is thrown:
java.io.ioexception cleartext http traffic to [("here goes the url of my remote server")] not permitted
I was researching about it and I'm supposed to create an xml network_secutiry_config
but I already have it created and with the necessary settings, what I can't explain is: Because it works correctly on the PC where the project was created but when I migrate it to another PC it throws me that exception? the database is on a remote server, not local, which should not give me any connection problems when running it on other PCs if the whole connection section works correctly on the source PC.
network_secutiry_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">https://pedidoslab.atspace.cc</domain> //Esta es la url del hosting que estoy utilizando
</domain-config>
</network-security-config>
AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
...
...
android:networkSecurityConfig="@xml/network_secutiry_config"
...
...
...
</application>
This is what I have for now, will there be any other additional configuration to avoid this type of exception?
Beforehand thank you very much!
Add this between the application tags of your AndroidManifest
If it persists try adding it like this