For people encountering this issue with a React Native app on Windows:
The new environment variables setup instructions no longer require a JAVA_HOME variable. It originally pointed to the Android Studio jre.
If you follow the instructions from @noman-baig AND remove the JAVA_HOME entry in your environment variables the issue should be fixed.