I'm using react-native 0.59.5 , I updated it from 0.57 version and find out the bug that my app doesn't run on Android 9 devices. App build is successful but when it starting to run I get the following error screen:
React Native version: 0.59.5
React Native Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 4.15 GB / 15.67 GB
Binaries:
npm: 6.4.1 - C:Program Filesnodejsnpm.CMD
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5314842
react-native run-androidLoading dependecy graph.doneDescribe what you expected to happen:
Expectation: Start the app as it should be.
Hi @ashotosipyan, adding android:usesCleartextTraffic="true" to your <application> tag in AndroidManifest.xml should fix the problem
@madoke you saved me man! thank you very much! it solved my problem
@madoke thank you! 馃槈
I have same problem with React native version 0.59.9 and Android 9 with Sdk : 28
but If I use the Android 8 then it works but in Android 9 it always show me same error
React Native Environment Info:
System:
OS: macOS 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 53.81 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 26, 27, 28
Build Tools: 27.0.3, 28.0.3
System Images: android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5264788
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: ^0.59.9 => 0.59.10
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
react-native-rename: 2.4.1
android:usesCleartextTraffic="true" why is working
Most helpful comment
Hi @ashotosipyan, adding
android:usesCleartextTraffic="true"to your<application>tag inAndroidManifest.xmlshould fix the problem