NetworkSecurityConfig: No Network Security Config specified — Android 7.0 error?

前端 未结 3 1372
醉话见心
醉话见心 2020-11-29 12:28

I have some problem for android 7.0.0.

I use volley library for my application, and it works well except for Android 7.0

Here is part of my code;

<         


        
相关标签:
3条回答
  • 2020-11-29 12:49

    try adding this to the manifest.xml

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

    and change the android emulator to pixel 2 API 28 from the AVD manager it worked for me in both windows and mac

    0 讨论(0)
  • 2020-11-29 12:53

    So, I don't think the previous answer was clear enough. (I spent a couple of hours trying to "debug" this)

    If you're seeing this prompt, the fact that it says

    D/ blablabla

    means that this is a Debug, and not an error. It's more like a notification to let you know that you didn't specify the NetworkSecurityConfig, and that it decided by itself to set it to default. Nothing wrong.

    Your error, however, will show itself as:

    E/ blebleble

    TL;DR You might be looking at the wrong place if you're trying to debug an error.

    0 讨论(0)
  • 2020-11-29 12:54

    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.

    0 讨论(0)
提交回复
热议问题