Having difficulty launching React-Native

Upon executing npx react-native run-android, I encountered the following message in the 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. The current environment is using Java 1.8. Suggested solutions include: - adjusting IDE settings - modifying JAVA_HOME variable - updating org.gradle.java.home in gradle.properties.

  • Try:

Run with --stacktrace option for a detailed stack trace. Use --info or --debug option for more log information. Employ --scan for comprehensive insights.

  • For additional assistance, visit

BUILD FAILED in 7s

An error occurred during app installation. Ensure that the Android development environment is properly configured: 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. The current environment is using Java 1.8. Suggested solutions include: - adjusting IDE settings - modifying JAVA_HOME variable - updating org.gradle.java.home in gradle.properties.

Answer №1

Always take the time to carefully read through any error messages you encounter, as they often provide valuable insight into what went wrong and how you can go about fixing it!

In this particular instance, the error message is indicating that your system lacks the necessary version of Java required for Gradle, the tool utilized by React Native for creating native Android builds. Specifically, Java 11 is needed, while your system currently only has version 1.8 installed.

To address this issue, it's essential to install an updated JDK. You can accomplish this task by referring to the instructions for setting up the React Native Environment tailored for Android on your specific operating system.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Establishing the JavaScript time and time zone using data stored in an SQL database and the ASP.NET code-behind page

I have a database field that indicates the user's timezone using integers, where anything greater than 0 represents an increased number of hours. My task is to showcase two different times on the user's screen For example: Your current time: " ...

Having difficulty deleting a checkbox element using JavaScript

My goal is to have a feature where users can effortlessly add or remove checkbox div elements as needed. The code I have written successfully adds and resets checkboxes, but I am encountering an issue when trying to remove them. I am struggling to identif ...

Tips for sending an array of data from the client to req.body in an axios request

I am facing an issue with sending user data collected from the front end via an ajax call to an axios post request in the back end. The parameters I need to pass include arrays of data, but when I check the req.body in the backend using console.log(), I no ...

Transferring data between Promises and functions through variable passing

I am facing a challenge. I need to make two separate SOAP calls in order to retrieve two lists of vouchers, and then use these lists to perform some checks and other tasks. I have placed the two calls within different Promise functions because I want to in ...

Using CURL in an Android application

After exploring multiple resources like blogs, websites, and Stack Overflow, I still couldn't find a solution to my issue. I have an application that shares images with a server. The server requires an API token for authentication, and the authenticat ...

OptimizeAssetsWithJarMergingDuringRelease Android Transformation

Hey everyone, I'm currently facing an issue while trying to generate a signed APK in Android Studio. I've done a lot of research on this problem, but unfortunately haven't found a solution that works for me. I know it's related to a du ...

Apple Watch does not vibrate when receiving notifications

After developing an Apple Watch app, I eagerly awaited the arrival of my actual watch to test it on a real device. Today was the day I finally had the chance to test my local notifications on my watch. However, every time I received a notification, there ...

Updating ng-table within an Angular controller

Having encountered an unusual issue with ng-table. Here is a snippet of code from my controller: this.category = "Open"; this.category = ["Open", "Accepted", "Rejected"]; this.dataItems = []; var _this = this; this.$scope.$watch("vm.category", function( ...

Safari IOS causing issues with Vue 2.6 functionality

I have implemented a button that, when clicked or pressed, triggers a click event on an input type=file, allowing the user to upload a file. This functionality works seamlessly on all platforms, but there is an issue with Safari/iOS Safari. In Safari, when ...

Imitate a hover effect

In my list, I have images and descriptions set up in the following format: <li> <img class="photography" src="PHOTO/boat.jpg" alt="Boat on sea." /> </li> <li><div id="description" class="description"> <p>BOAT</p> ...

Indicator malfunctioning on Carousel feature

I created a carousel containing six photos, but I am encountering an issue with the carousel indicators below. The first three indicators work correctly – when clicked, they take me to the corresponding slide (e.g., clicking the 1st indicator takes me ...

TypeScript definition for a combination of letters, numbers, and symbols

Can you help me define a type for a response that has this format? TYGOokcgyA9-FQZPM7-evpely6ETEnLyU2yq6hTD_XpTWkPckEP5bFm79hUTtE7rpa6Aiqc6s7xcTXQNNLSClTWtmc7uMIhf-44r3W3d7qY_LkhkGKuv In Typescript, what type should I use for this structure? export interf ...

Organizing data by year and semester for display in Laravel Blade

I am working on organizing and printing data based on school year and semester in Laravel. In MS Access, I can achieve this using relationship and group reports, but I'm facing challenges in implementing it in Laravel. Below are some sample records: ...

The request body parser for the express POST method appears to be devoid of

After encountering similar issues on Stack Overflow, I discovered a solution involving the use of: app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); However, despite implementing this solution, the log for req.body is still ...

Should custom directives be utilized for templating within AngularJS applications?

Thinking about optimizing my AngularJS app, I'm considering creating custom directives for the navigation bar and footer which appear on every page. This way, I can easily modify them without having to update each individual html file. Do you think th ...

Alert Div from Bootstrap fails to appear during the second ajax request if the first ajax request is canceled

I've implemented a dismissible alert in my HTML file that starts off hidden. Here's the code snippet: <div class="alert alert-dismissible" role="alert" id="msgdiv" style="margin-bottom:5px;display: none;"> <button type="button" clas ...

Updating the title in Angular with UI Router when $stateChangeSuccess is triggered too soon?

My implementation of a custom page title follows the ngBoilerplate framework: https://github.com/ngbp/ngbp/blob/v0.3.1-release/src/app/app.js .controller( 'AppCtrl', function AppCtrl ( $scope, $location ) { $scope.$on('$stateChangeSucces ...

Using TextField with nested Object for onChange Event

I have a question that needs some clarification. Here is the current structure of my object. Within "allgemein," there are currently two variables, but they will increase over time... { id: "Abadi", name: "Abadi", type: "SC", allgemein: { ...

How can I utilize JavaScript to call a Delphi function in TWebBrowser on Delphi XE6 for all platforms, such as iOS and Android?

My goal is to develop an application using Delphi XE6 for Android and iOS that utilizes a TWebBrowser to display Google Maps. I need the ability to communicate between Delphi and JavaScript, allowing me to interact with markers on the map based on user inp ...

Tips for capturing everything in NextJs with getStaticPaths

My current challenge involves utilizing getStaticProps and getStaticPaths to dynamically generate pages at build time. This is my first experience working with CatchAll routes, so I embarked on a search for solutions. Unfortunately, none of the results al ...