How to resolve the problem "Error! Network is not available" in android 9 and higher
It may due to the your website that's not secure enough , to skip this problem please try this solution :
First open your androidmanifest.xml file and add this line of code inside the application tag
android:networkSecurityConfig="@xml/network_security_config"
like this example :
<application android:name="com.domain.apps.appname.AppController" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" android:largeHeap="true" android:supportsRtl="true" android:networkSecurityConfig="@xml/network_security_config" tools:replace="android:icon,android:theme">
Then go and create a new file in the XML folder , copy this content into this file :
<?xml version="1.0" encoding="utf-8"?> <network-security-config> <base-config cleartextTrafficPermitted="true"> <trust-anchors> <certificates src="system" /> </trust-anchors> </base-config> </network-security-config>
Remove the app from your device and start to runing the app again from your android studio .
Good luck in your business.