Android React-Native

React Native App: Task :app:processDebugMainManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String accessible: module java.base does not "opens" to unnamed module @379b3356

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at


error Failed to install the app. Make sure you have the Android development environment set up:
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

I had the same problem (JDK 16) and fixed it with:

cd android && gradlew clean
cd ..

npx react-native start

This will run the metro window
then open android studio and let it clean project
run app in android studio