Skip to content

usesCleartextTraffic configuration issue in build.gradle #60083

Open

Description

@arnolddozsa

Description

Cannot configure usesCleartextTraffic in build.gradle manifestPlaceholders because the plugin always overrides it.
AppConfiguratorUtils:31

Fix: I could set a custom variable in manifestPlaceholders and use it in Android.manifest by the way.

Steps to reproduce

  1. set usesClearTextTrafic in build.gradle
    buildTypes {
    debug {
    ...
    }
    release {
    ...
    manifestPlaceholders = [
    usesCleartextTraffic: "true"
    ]
    }
    }
  2. In Android.manifest use it
    <application
    android:name=".MainApplication"
    android:label="@string/app_name"
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:allowBackup="false"
    android:theme="@style/AppTheme"
    android:usesCleartextTraffic="${usesCleartextTraffic}"
  3. build the app
  4. install and try a network request on http with fetch or axios

React Native Version

0.86.3

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: Windows 10 10.0.19045
  CPU: (12) x64 Intel(R) Xeon(R) W-11855M CPU @ 3.20GHz
  Memory: 24.09 GB / 63.21 GB
Binaries:
  Node:
    version: 22.22.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.22
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 10.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "26"
      - "28"
      - "30"
      - "31"
      - "32"
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 32.0.0
      - 33.0.0
      - 34.0.0
      - 35.0.0
      - 36.0.0
    System Images:
      - android-26 | Google Play Intel x86 Atom
      - android-30 | Google APIs Intel x86 Atom
      - android-33 | Google APIs Intel x86_64 Atom
    Android NDK: 22.1.7171670
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-243.26053.27.2432.13536105
  Visual Studio:
    - 17.10.35013.160 (Visual Studio Community 2022)
Languages:
  Java:
    version: 17.0.12
    path: C:\Program Files\Eclipse Adoptium\jdk-17.0.12.7-hotspot\bin\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 20.2.0
    wanted: 20.2.0
  react:
    installed: 19.3.1
    wanted: 19.3.1
  react-native:
    installed: 0.86.3
    wanted: 0.86.3
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

11-17 12:54:24.748 I/ReactNativeJS(10835): 'Fetch error:', [TypeError: Network request failed]
11-17 12:54:24.748 I/ReactNativeJS(10835): 'Message:', 'Network request failed'
11-17 12:54:24.748 I/ReactNativeJS(10835): 'Stack:', 'TypeError: Network request failed\n    at anonymous (address at index.android.bundle:1:1549176)'

MANDATORY Reproducer

https://mhzq.com/RNTesterPlayground.js

Screenshots and Videos

No response

Activity

  1. react-native-bot commented on Nov 17, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions