React-Native : Can't show remote images in release mode on android device

后端 未结 2 539
有刺的猬
有刺的猬 2021-01-25 17:30

im runing a simple react-native application in my android device (samsung 9, Android 9, API 28), so on debug mode it\'s work fine using this commande line :

react         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-25 18:32

    Android pie (9) doesn't allow non https images to be rendered, so you have to change your http requests to https or to set a networkSecurityConfig in your Manifest application tag like this:

    
    
        
        
    
    

    Then in your xml folder you now have to create a file named network_security_config just like the way you have named it in the Manifest and from there the content of your file should be like this to enable all requests without encryptions:

    
    
        
            
                
            
        
    
    

    source: https://developer.android.com/training/articles/security-config

提交回复
热议问题