Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing piece in upgrade guide to 0.59 #23949

Closed
mehulmpt opened this issue Mar 15, 2019 · 4 comments
Closed

Missing piece in upgrade guide to 0.59 #23949

mehulmpt opened this issue Mar 15, 2019 · 4 comments
Labels
Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot. Type: Docs Issues concerning the docs are tracked elsewhere: https://github.com/facebook/react-native-website

Comments

@mehulmpt
Copy link

Local development builds fail with targetSdkVersion 28 because starting from Android 9, clearText support is disabled (https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted). It is not mentioned anywhere in the docs, maybe we could include it somewhere?

To make sure the app is able to communicate with metro bundler, you need to add android:usesCleartextTraffic="true" to your AndroidManifest.xml file so it should finally look something like:

 <application
      android:name=".MainApplication"
      //...
      android:icon="@mipmap/ic_launcher"
	  android:usesCleartextTraffic="true" <-- add this
    // ....
>

If you don't add this, your app would build and launch but would fail with the following screen:

error

@mehulmpt mehulmpt added the Type: Docs Issues concerning the docs are tracked elsewhere: https://github.com/facebook/react-native-website label Mar 15, 2019
@ehsan680
Copy link

Throws the same error for me even after adding android:usesCleartextTraffic="true"in AndroidManifest.xml

@mehulmpt
Copy link
Author

@ehsan680 did you rebuild the app?

@ehsan680
Copy link

Yes, have cleared cache etc and have rebuild the app. App still works fine in release build though.

@Salakar
Copy link
Contributor

Salakar commented Mar 21, 2019

Hey all 👋 this was documented here: https://facebook.github.io/react-native/docs/integration-with-existing-apps#network-security-config-api-level-28 (android tab)

I'll close this for now but I'll see if I can get this added to the release notes/upgrade guide also.

EDIT: I've sent a PR to update the documentation to using usesCleartextTraffic facebook/react-native-website#847

@Salakar Salakar closed this as completed Mar 21, 2019
@Salakar Salakar added the Resolution: Fixed A PR that fixes this issue has been merged. label Mar 21, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Mar 21, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot. Type: Docs Issues concerning the docs are tracked elsewhere: https://github.com/facebook/react-native-website
Projects
None yet
Development

No branches or pull requests

4 participants