title: Execution failed for task ':app:processDebugMainManifest'. in ReactNative CLI
body: <p>I try to build a ReactNative app using ReactNative CLI following the steps in their documentation: <a href="https://reactnative.dev/docs/environment-setup" rel="nofollow noreferrer">Link for the documentation</a></p>
  <p>After downloading the initializing the App I tried to run the app:</p>
  <ol>
  <li><code>npx react-native start</code> - to start the metro bundler and it's successfully launched.</li>
  <li><code>npx react-native run-android</code> - to start the application on the android emulator but failed to build.</li>
  </ol>
  <p>It gave the following error message:</p>
  <blockquote>
  <p>error Failed to install the app. Make sure you have the Android
  development environment set up:
  <a href="https://reactnative.dev/docs/environment-setup" rel="nofollow noreferrer">https://reactnative.dev/docs/environment-setup</a>. Error: Command failed:
  gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 Warning:
  Mapping new ns <a href="http://schemas.android.com/repository/android/common/02" rel="nofollow noreferrer">http://schemas.android.com/repository/android/common/02</a>
  to old ns <a href="http://schemas.android.com/repository/android/common/01" rel="nofollow noreferrer">http://schemas.android.com/repository/android/common/01</a>
  Warning: Mapping new ns
  <a href="http://schemas.android.com/repository/android/generic/02" rel="nofollow noreferrer">http://schemas.android.com/repository/android/generic/02</a> to old ns
  <a href="http://schemas.android.com/repository/android/generic/01" rel="nofollow noreferrer">http://schemas.android.com/repository/android/generic/01</a> Warning:
  Mapping new ns <a href="http://schemas.android.com/sdk/android/repo/addon2/02" rel="nofollow noreferrer">http://schemas.android.com/sdk/android/repo/addon2/02</a>
  to old ns <a href="http://schemas.android.com/sdk/android/repo/addon2/01" rel="nofollow noreferrer">http://schemas.android.com/sdk/android/repo/addon2/01</a>
  Warning: Mapping new ns
  <a href="http://schemas.android.com/sdk/android/repo/repository2/02" rel="nofollow noreferrer">http://schemas.android.com/sdk/android/repo/repository2/02</a> to old ns
  <a href="http://schemas.android.com/sdk/android/repo/repository2/01" rel="nofollow noreferrer">http://schemas.android.com/sdk/android/repo/repository2/01</a> Warning:
  Mapping new ns <a href="http://schemas.android.com/sdk/android/repo/sys-img2/02" rel="nofollow noreferrer">http://schemas.android.com/sdk/android/repo/sys-img2/02</a>
  to old ns <a href="http://schemas.android.com/sdk/android/repo/sys-img2/01" rel="nofollow noreferrer">http://schemas.android.com/sdk/android/repo/sys-img2/01</a></p>
  </blockquote>
  <blockquote>
  <p>Execution failed for task ':app:processDebugMainManifest'.</p>
  <blockquote>
  <p>Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not &quot;opens
  java.io&quot; to unnamed module @26c4a53</p>
  </blockquote>
  </blockquote>
  <p>The problem is I have already added the required path variables as follows. So, how can I get the above error? Does anybody know how to resolve this issue, please?</p>
  <p><strong>Screenshot of the powershell output for checking 'User variables':</strong></p>
  <p><a href="https://i.stack.imgur.com/g8Bqw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g8Bqw.png" alt="enter image description here" /></a></p>