Márius Rak
Márius Rak

Reputation: 1472

React-native get stuck at Dependency Graph

I try to start with react-native, I've installed everything and got to phase where I have RSoD on my phone which is telling me to run server. When i run react-native start lot of things runs, but then it gets stuck at <END> Building Dependency Graph and I have no idea what to do with it. So, how can I make it continue?

Upvotes: 36

Views: 50263

Answers (21)

James Broad
James Broad

Reputation: 1280

I was hitting this on my CI servers (well, running react-native bundle). My resolution was to manually add the flag --max-workers 4.

I speculate this is because CI servers do funky things with virtualisation of CPUs which affects the defaults detected in react-native.

Upvotes: 0

Mahendra Liya
Mahendra Liya

Reputation: 13218

I faced a similar problem on Mac, tried downgrading the Node version but it didn't help.

I was testing on Android and executing the below command helped move forward:

adb reverse tcp:8081 tcp:8081

Upvotes: 0

Pratik Adhikari
Pratik Adhikari

Reputation: 517

Add a line of code given below, in your android/app/build.gradle

implementation 'com.facebook.android:facebook-android-sdk:5.0.0'

along with gradle version 5.5.1 in gradle-wrapper.properties as:

distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip

Upvotes: 0

fxbayuanggara
fxbayuanggara

Reputation: 337

Restart everything, restart your laptop, then run the build command again, everything will work again.

Upvotes: 1

hamza ahmad
hamza ahmad

Reputation: 51

if you on Ubuntu type in terminal

sudo sysctl -w fs.inotify.max_user_instances=1024
sudo sysctl -w fs.inotify.max_user_watches=100000
watchman shutdown-server

then type in terminal react-native start

Upvotes: 0

Highspeed
Highspeed

Reputation: 442

I am somehow able to get this to work by going into a fresh chrome instance and going to either "localhost:8081" or your local ip:8081... somehow after about a minute or three it snaps out of it.

Upvotes: 0

Sasmitha Dasanayaka
Sasmitha Dasanayaka

Reputation: 81

I also met with the same issue, then I used a version when creating the app in react CLI..

react-native init project_name --version x.xx.x
eg:react-native init project_name --version 0.49.0

or u can overcome this by installing a different nodeJS version

Upvotes: 0

Ancy
Ancy

Reputation: 11

In my case I had proxy settings enabled on the Android emulator. I solved the problem by disabling the proxy settings.

Upvotes: 1

Mathias
Mathias

Reputation: 213

I solved this problem by going to Settings > Apps and Notifications > Show All Apps > The app im trying to start and then the three dots in the top right corner and uninstall for all users. Then i ran yarn run android again

Upvotes: 0

andersr
andersr

Reputation: 1051

One reason the "Building Dependency Graph" step might hang may be due to that there is a (Chrome) debugger session running from a previous session or another project. One way to fix that is to completely quit out of Xcode, your terminal, and Chrome and then restart everything. I'm sure there is a better way to fix the issue, but that is what worked for me.

Upvotes: 22

Andreas Bigger
Andreas Bigger

Reputation: 5540

Enter the ios sub-directory and run a pod install:

cd ./ios
pod install

Then, in the main project directory, run react-native run-ios.

Upvotes: 1

Suman Kharel
Suman Kharel

Reputation: 1090

Please try below actions if you created your app with react-native init YOUR_APP_NAME and are using android studio with AVD simulator.

  1. Make sure that your network is not firewall protected. If it is, the wifi in your simulator does not work (at least for me). Try using other networks / mobile hotspot.
  2. Make sure that the simulator is using android version pie with API level 28 as mentioned in the react-native documentation.
  3. Open android studio and run the simulator.
  4. If you are in windows platform, run the code using react-native run-android instead of npm start
  5. If you are on mac, run the code using react-native run-ios instead of npm start
  6. Wait for few minutes. The application should open in your simulator after loading the dependencies.

Upvotes: 0

Azhar
Azhar

Reputation: 20670

In my case I opened

Command prompt

as Administrator reached to the app location and enter

react-native start

it goes till Loading dependency graph, done. Then I remained it open and open another command prompt as Administrator go to the app location and entered

react-native run-android

and its worked....

In mac open Terminal instead of Command prompt and rest is same.

Peace ...

Upvotes: 7

Max Phillips
Max Phillips

Reputation: 7489

Make sure both your device and your laptop are on the same wi-fi network. My phone was on LTE and my laptop was on my regular wi-fi.

Upvotes: 0

Sanjeev Rao
Sanjeev Rao

Reputation: 2297

This could be one of the reasons, Try with uninstalling the app from device/emulator/simulator and re-run the command

Upvotes: 0

Martin Cup
Martin Cup

Reputation: 2582

I had the same problem, that it ended there and even refreshing the simulator didn't make the packager to go on. Then I figured it out: I was still connected to the Internet via a VPN, so the simulator couldn't connect to the packager. Simply closing the VPN solved the issue.

Upvotes: 8

Rajesh Bhartia
Rajesh Bhartia

Reputation: 758

 sudo sysctl -w fs.inotify.max_user_instances=1024
 sudo sysctl -w fs.inotify.max_user_watches=100000

you can try this bunch of line in your terminal. Just increase the max_user_watches number and it worked for me.

Upvotes: 2

carloseme
carloseme

Reputation: 49

Shake your device, on the menu, select enable live reload and enable hot reload

Upvotes: 0

Daniel Vitiello
Daniel Vitiello

Reputation: 81

This problem can also be caused if you changed the jsCodeLocation to use a static bundle in AppDelegate.m for a release build and didn't change it back to the local settings.

https://facebook.github.io/react-native/docs/running-on-device.html#3-configure-app-to-use-static-bundle

Upvotes: 0

Sakezzz
Sakezzz

Reputation: 468

After the command react-native run-android worked for me. I just waited library installings, after that it worked.

Upvotes: 4

Daniel Schmidt
Daniel Schmidt

Reputation: 11921

The building of the dependency graph may take some time (ca 1-3 minutes). The progress is shown by a percentage behind this line; if the percentage disappears you are ready. The react-native start command doesn't terminate, as it continues to serve the transformed source code with the react native packager. Your app will make requests to the provided url if you have the default settings.

Upvotes: 7

Related Questions