Android App: How to set usesCleartextTraffic = false

Please provide the following:

  1. SDK Version: 40
  2. Platforms(Android/iOS/web/all): Android
  3. app.json

It seems that usesCleartextTraffic is set to true by default and that caused my App could not pass the client’s pentest (security tester). Is there a way to set usesCleartextTraffic = false? I did try in “android/app/src/main/AndroidManifest.xml” but it is ignored when Expo building.

Also tried to put usesCleartextTraffic to app.json but got error.

Please help!

1 Like

Hey @tm01xx, can you let me know what type of project you are working with and how you are building your binary?

If it’s a Managed project, this will be trickier but doable by leveraging expo config plugins and the expo prebuild command. See here.

Cheers,
Adam

Hi,

Thanks for replying. My project is bared one. I build it by using “expo eject” then “expo build:android” command.

I will try your suggestion and let you know if it works. Thanks again!

Best regards,

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.