Having difficulties initiating the JS server due to insufficient information

After creating a fresh react-native project, I encountered a problem when running the command react-native run-android. The project consistently gets stuck at the message info Starting JS server....

Below is the output of the command:

$ react-native run-android
info Running jetifier to migrate libraries to AndroidX".
 You can disable it using "--no-jetifier" flag.
Jetifier found 855 file(s) to forward-jetify. Using 4 workers...
info Starting JS server..."

I attempted to restart my laptop and switch emulators, but the issue still persists. I am now unsure of what steps to take next.

Can someone help me troubleshoot and resolve this problem?

Answer №1

Stop the metro bundler command prompt that pops up on its own

Terminate the command terminal that is currently executing react-native run-android

Proceed to launch react-native start to start your JS server

In a new command prompt window, execute react-native run-android The app loaded in just 5 minutes on an emulator.

Answer №2

Accessing Linux: Navigate to the terminal and input the following command: react-native start

Afterwards, in a DIFFERENT terminal, within your project directory: yarn android or npm run android

Answer №3

Quick workaround:

REACT_TERMINAL= react-native run-android

For my specific setup using manjaro + xfce4:

REACT_TERMINAL=xfce4-terminal react-native run-android

Alternatively, add this to your .bashrc:

export REACT_TERMINAL=xfce4-terminal

Source: https://github.com/facebook/react-native/issues/26097

Answer №4

Encountered a similar issue where a project worked yesterday but not today. The culprit appears to be the "@react-native-community/cli-platform-android". Today's version is 2.8.2 while yesterday's was 2.7.0.

I resolved it by installing:

npm install @react-native-community/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1477787d3964787560727b667b7d7054263a233a24">[email protected]</a>

Although not an ideal solution, it should help you move forward.

Answer №5

For Manjaro OS users like myself, here is the procedure I follow: Firstly:

npm start

Next, in a different terminal window:

npm run android

Answer №6

My frustrating issue was unique compared to other answers.

In my case, the problem with Android adb was due to a program that had taken over port 5037, causing adb to hang silently (why adb! .. say something!)

To determine if this is your issue, try the following commands:

Run any adb command and see if it hangs, for example:

adb devices

If it hangs, check which program is using the port:

sudo lsof -i :5037

Answer №7

One effective method I frequently rely on is accessing the application manager on my Android device and clearing the app's data. This usually results in smooth app performance without any lagging issues.

Answer №8

Fixing the problem by either reinstalling android studio with a fresh emulator or updating the app name in app.json , build.gradle and android manifest.xml was successful.

Answer №9

Experiencing a similar problem caused by the react-native reanimated package Step 1: Launch Visual Studio, and open either the terminal cmd or powershell Step 2: Run npm uninstall react-native-reanimated Step 3: Navigate to the android folder by typing cd android Step 4: Execute ./gradlew clean Step 5: Press enter and watch the magic happen

Answer №10

After installing Expo, I noticed that my project name changed to something else. When I decided to stop using Expo and encountered issues running on Android, I finally figured out that I needed to update the name in package.json to match the one in app.json.

It's important to ensure that the project name remains consistent in both app.json and package.json.

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

Using React - What is the best way to invoke a function from within a different function?

Imagine this scenario: class Navigation extends React.Component { primaryFun() { console.log('funn') } secondaryFun() { this.primaryFun(); } } I assumed that calling primaryFun within secondaryFun would work as expected, but instead I rec ...

Using React, a link to the same component is created, but a subcomponent is mistakenly using an outdated version of

Here, we have a SubComponent and a MainComponent created to showcase an image collection. The Subcomponent allows you to toggle between pictures in the collection using the onclick() event. The MainComponent also includes links to other collections, which ...

Modifying website elements with JavaScript

Can someone assist me with getting a script to work on my website that will allow me to switch between four different sets of content using buttons labeled 1, 2, 3, and 4? I have tried using addClass and removeClass but cannot seem to get it right. Here i ...

What is the preferred default value for a property awaiting assignment from a GET response: Undefined or Null?

Say I need to display information about a product, but first I must make a GET request to get the data and assign it to the product. I'm wondering, should the default value for product in the data() function be undefined or null, and is there a differ ...

Encountered an issue with JSON serialization while using getServerSideProps in Next.js and TypeScript to retrieve products from the Stripe Payments API

Encountered Issue on Localhost Error: The error occurred while serializing .products returned from getServerSideProps in "/". Reason: JSON serialization cannot be performed on undefined. Please use null or exclude this value. Code Sample import ...

Updating device information in real-time using React Native

Currently, I am utilizing react-native-device-info to access the DeviceLocale or DeviceCountry. However, I am wondering if there is a method to update Device-info without requiring a complete restart of the app. For instance, when my device language is se ...

Rotate the image as you swipe left or right with Angular's ng-swipe-left and ng-swipe-right features

I am currently utilizing angular's ng-swipe-left and ng-swipe-right to detect swipe events on touch devices. My goal is to rotate an image based on the speed and direction of the swipe while it is still in progress. However, I am facing a challenge as ...

Is the AngularJS application failing to transmit data accurately to Node.js?

I've been grappling with this issue for a few days now and I can't seem to pinpoint the problem. As someone relatively new to the MEAN stack, I might be overlooking something obvious. I followed the boilerplate code from mean.io for both the back ...

Error encountered in MySQL and NodeJS: Unable to add new query after invoking quit with transactions

While working on implementing MySQL for NodeJS and Restify, I encountered a flawless experience with queries. However, when attempting to utilize data updating functionality through transactions, I faced the error message: Error: Cannot enqueue Query after ...

What is the correct way to define the field name in the update() function of Mongoose?

When attempting to update every field contained in the dataToChange object, I encountered a problem where the update() method does not take the key name from the outside. Instead, it looks for a "key" field within the database's object. How can I work ...

Swap out a portion of HTML content with the value from an input using JavaScript

I am currently working on updating a section of the header based on user input from a text field. If a user enters their zip code, the message will dynamically change to: "GREAT NEWS! WE HAVE A LOCATION IN 12345". <h4>GREAT NEWS! WE HAVE A LOCATIO ...

Looping through elements using .each in jQuery and accessing their values in the following iteration

Here is the code snippet I've been working on: var index=0; var load=0; $("td.load_ads").each(function(){ var loading=$(this); $.post('/self_coded_helpers/jpost_get_ads.php',{index:index,type:'fetch_id' ...

What is the reason behind having to restart the npm server each time?

When first learning Reactjs with VSCode, there was no need to restart the server after making modifications. However, now I find that I must restart the server every time I make a change in order for those changes to be applied. ...

Learn how to use jQuery to load a text file containing arrays and then format them as

I'm attempting to load a .txt file containing multidimensional arrays using AJAX, and then sort through the data to display it on my website. However, I'm facing an issue where the data is only returning as plain text, even after trying to use JS ...

Access data from JSON array in Angular 2

I'm facing a basic issue here. I have a JSON file named pageDefinition.json that is being loaded into my component. Here's how the JSON data looks: ... "testArray": [ {"id": 0, "name": "row1"}, {"id": 1, "name": "row2"}, {"id": 2, "n ...

Repeated actions using jQuery

Being new to jQuery, I am currently exploring ways to repeat functions without the need to continuously write them over and over again. In the code snippet below, you can see that when a button is clicked, it changes to 'I was clicked' in an h1 t ...

What exactly does the context parameter represent in the createEmbeddedView() method in Angular?

I am curious about the role of the context parameter in the createEmbeddedView() method within Angular. The official Angular documentation does not provide clear information on this aspect. For instance, I came across a piece of code where the developer i ...

How to Handle the Absence of HTML5 Spellcheck in Specific Web Browsers

While HTML5 spellcheck functionality may vary across different browsers, there are instances where it might not be supported in certain corporate environments. In the event that HTML5 is not supported in a particular browser, it's essential to first c ...

What are the steps to achieve consistent response behavior in POSTMAN that matches that of a web browser?

Below is an example of my code: const express = require('express'); const app = express(); app.get('/', function (req, res) { res.setHeader('Content-Type', 'text/html'); res.write("First \n"); set ...

What is the proper way to handle postMessage events from a Streamlit iframe within a Next.js app?

I'm currently in the process of integrating a Streamlit app into a Next.js application by embedding the Streamlit within an iframe. My main goal is to send data from the Streamlit app to the Next.js parent using window.postMessage, specifically focusi ...