NetworkSecurityConfig: No Network Security Config specified, using platform default Error response code: 400
Try these solutions
Solution 1)
Add the following attribute to the <application
tag in AndroidManifest.xml
:
android:usesCleartextTraffic="true"
Solution 2)
Add android:networkSecurityConfig="@xml/network_security_config"
to the <application
tag in app/src/main/AndroidManifest.xml
:
<application
android:name=".ApplicationClass"
android:allowBackup="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:supportsRtl="true"
android:theme="@style/AppTheme">
With a corresponding network_security_config.xml
in app/src/main/res/xml/
:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
Refer this answer for more info:
Download Manger not working in Android Pie 9.0 (Xiaomi mi A2)
NetworkSecurityConfig: No Network Security Config specified -- Android 7.0 error?
There is no problem with this message:
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
The D/
indicates that this is a debugging message. It indicates that you do not have your own network security configuration defined, and so platform-default rules apply. This is perfectly fine.
application looks empty because it does not response from the internet
Near as I can tell, you are parsing some JSON, iterating over it, and populating kisiler
. Perhaps kisiler
is not connected to your UI.
Android Emulator: No Network Security Config specified, using platform default
try to change your network_security_config.xml
like below :
<network-security-config>
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
and the manifest
like :
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:targetSandboxVersion="1" android:versionCode="1" android:versionName="1.0" package="com.companyname.app71" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<application android:label="Meha" android:icon="@drawable/logo_pink" android:networkSecurityConfig="@xml/network_security_config" android:hardwareAccelerated="true" android:largeHeap="true"></application>
</manifest>
as the Network security configuration said,
The default configuration for apps targeting Android 9 (API level 28) and higher is as follows:
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
The default configuration for apps targeting Android 7.0 (API level 24) to Android 8.1 (API level 27) is as follows:
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
The default configuration for apps targeting Android 6.0 (API level 23) and lower is as follows:
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
<certificates src="user" />
</trust-anchors>
</base-config>
Related Topics
String-Date Conversion with Nanoseconds
How to Activate "Share" Button in Android App
How to Detect a Click in an Ontouch Listener
Listview Viewholder Checkbox State
Android 3.1 Usb-Host - Broadcastreceiver Does Not Receive Usb_Device_Attached
How to Instantiate an Abstract Class Directly
Using Serviceloader on Android
Android:Table Has No Column Named "Variable Name" MySQL Database Error
Jruby: Watir Is Hanging When Launching Browser
Check Chains of "Get" Calls for Null
Polygon Touch Detection Google Map API V2
Android: Specify Two Different Images for Togglebutton Using Xml
Return Data from Asynctask Class
Caused By: Java.Lang.Classnotfoundexception: Didn't Find Class in Firebase Phone Authentication
Does Proguard Work to Obfuscate Static String Constants
Gson Expected Begin_Array But Was Begin_Object
How to Install "Android Support Library" to Deploy a Gluon Mobile Application to Android