• Register
0 votes
1.2k views

Problem :

I want to print the list of values in ListView from the webpage. I have the following two permission

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

But I am troubled by following message:

D/NetworkSecurityConfig: No Network Security Config specified, using platform default

I do not know what it means and how can I fix it.

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I am sharing my local context solution.

I have the Docker/Lando instance which provides me an API from the Lumen Restful app, local domains are not working but when I tried to check my network IP using "ifconfig" in my terminal I was able to access using that IP using below command:

$ ifconfig

You should also try to add the new parameter to your AndroidManifest.xml as given below :

android:networkSecurityConfig="@xml/network_security_config"

I am using following network_security_config.xml file for my local debugging you can also try using one.

<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:android="http://schemas.android.com/apk/res/android">
    <debug-overrides>
        <trust-anchors>
            <certificates src="user" overridePins="true"/>
        </trust-anchors>
    </debug-overrides>
</network-security-config>

I use the user-permissions as well as below:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 

If above solution is not working for you then try below one

Add below code:

android:usesCleartextTraffic="true"

To your manifest application and check if it works for you:

 <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:usesCleartextTraffic="true"
        android:theme="@style/AppTheme"
    >
9 7 4
38,600 points

Related questions

0 votes
1 answer 2 views
2 views
Problem: I got a AsyncTask that is supposed to check the network access to a hostname. But the doInBackground() is never timed out. Does anyone have a clue?
asked Apr 24 ummeshani 8.8k points
0 votes
1 answer 646 views
646 views
Problem : I am getting bellow in Android Studio java.lang.runtimeexception: an error occurred while executing doinbackground()
asked Oct 19, 2019 peterlaw 6.9k points
0 votes
1 answer 22 views
0 votes
1 answer 1 view
1 view
Problem: I was trying to find a specific certificate on my machine, and I ran into an odd issue. I was seeing The specified network resource or device is no longer available errors when calling: Get-ChildItem -Path "XXXXX" -Recurse Where "XXXX" was the thumbprint of ... it. It's blocking me on the local installation of a client's solution, so any help or ideas are very much appreciated. Thanks!
asked 1 day ago anika11 32k points
1 vote
1 answer 2 views
2 views
Problem: Please help me to solve it out : the specified network name is no longer available windows 10
asked Apr 12 MUHAMMAD MUNEEB 83k points
0 votes
1 answer 79 views
79 views
Problem: no target specified and no devices found, deploying to emulator.
asked Feb 21 charles mathews 5.5k points
0 votes
1 answer 16 views
16 views
no default engine was specified and no extension was provided.
asked Feb 16 ArifulIslam 7.5k points
0 votes
1 answer 706 views
0 votes
1 answer 458 views
458 views
Problem: I have fundamental knowledge of node.js, mongodb and expressjs. Currently I am trying to use the expressjs only for a backend. I also want to store data into a mongodb using the express. All of my view part is completely done in zend. I do not need the view to be in ... is how I have tried to redirect it to index.js app.get("/index",function(req,res){ console.log("route to index"); });
asked Aug 13, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 145 views
145 views
Problem : I want to open a program for the first time on Windows XP Pro that uses PostgreSQL 9. I am facing an error message that says : A problem was encountered while trying to log into or create the production database. Details: [Microsoft][ODBC Driver Manager] ... = MSDASQL". Changing this entry alters a error message I get to "Provider cannot be found, it may not be properly installed".
asked Jan 17, 2020 jwilliam 3.9k points