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

 参考文章:https://www.jianshu.com/p/5aba3b19a3e5

首先给app添加网络访问权限

 在AndroidManifest.xml中添加




  这样还不能够使用  ,需要给app添加证书

在AndroidManifest.xml中添加

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
       android:networkSecurityConfig="@xml/network_security_config"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
      
    

并新建相关xml资源文件,路径如下:res/xml/network_security_config.xml


    
        
            example.com
            
                7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=
                
                fwza0LRMXouZHRC8Ei+4PyuldPDcf3UKgO/04cDM1oE=
            
        
    

 

转载于:https://www.cnblogs.com/sq-9701/p/11284353.html

你可能感兴趣的:(D/NetworkSecurityConfig: No Network Security Config specified, using platform default)