After running npx react-native run-android here is the message from terminal:
FAILURE: Build failed with an exception.
Where: Build file '/Users/vivek/Documents/Code-Here/React-Native/instaClone/android/app/build.gradle' line: 1
What went wrong: A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'. Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing
org.gradle.java.homeingradle.properties.
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.
BUILD FAILED in 7s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
Where: Build file '/Users/vivek/Documents/Code-Here/React-Native/instaClone/android/app/build.gradle' line: 1
What went wrong: A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'. Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8. You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing
org.gradle.java.homeingradle.properties.
Be sure to always read the error message carefully, because it will likely tell you what is wrong and how you can fix it!
In this case, the error is telling you that you don't have the correct version of Java installed on your system. Gradle, which React Native uses to create a native Android build, requires Java 11 to be installed on your system, whereas you only have version 1.8.
This means you need to install an up-to-date JDK, which you can do by following the React Native Environment Setup instructions for Android for your specific operation system.