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

后端 未结 2 541
有刺的猬
有刺的猬 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:22

    We were having crashes and issues in development with our icons not being written out and appearing like images_homeactive. This caused react-native-navigation to crash our app

    This occurred when we upgraded to compileSDKVersion = 28.

    Starting with Android 9 (API level 28), cleartext support is disabled by default

    this prevents your application from connecting to the React Native packager. The changes below allow cleartext traffic in debug builds.

    ../app/src/main/AndroidManifest.xml
    
    
    ../android/app/build.gradle
    buildTypes {
        release {
            ...
            manifestPlaceholders = [isDebug:false]
        }
        debug {
            ...
            manifestPlaceholders = [isDebug:true]
        }
    }
    

    So thankful to stumble upon Ahmed's answer. Hope this helps someone.

提交回复
热议问题