1

I have initiated an starter app with React native Cli official documentation, after connecting adb emulator or physiacl device through usb, adb devices shows the device, it says jetifier found 85 files to forward-jetify, using 4 workers... and does nothing. enter image description here

while trying to open android folder in android studio and run it says gradle sync failed...NDK version not found! don't know whats theproblm? Is there any issue with the latest version of react-native.

Edit

later i was able to run it through android studio, but now it throws this error. opening screen, unable to load script

Vikas Pandey
  • 1,115
  • 1
  • 15
  • 25
  • After you get the `jetifier found...` message you should wait it takes a while in the first build. Also make sure not to close the React Native Bundler (A terminal/command prompt window that starts automatically) while debugging. – Heysem Katibi Aug 22 '19 at 11:14
  • 'react native bundler' didn't get an additional terminal opened for this for me, just waiting on jetifier found... – Vikas Pandey Aug 23 '19 at 10:40
  • your project has node_modules? if you had it just delete it and if you got package-json.lock run npm install or yarn.lock run yarn on command line. then you need to run react-native run-android after jetifier found ... you will able to see the dependencies get updated and after that node cli will appear – moloud ayat May 15 '21 at 06:36

3 Answers3

1

Before running react-native run-android , make sure to open project in android studio.

Steps:

  1. Download Android studio if not downloaded
  2. Click on open an existing android project
  3. Navigate to your android folder . eg AwesomeProject > android > click on build.gradle

    Project will start syncing(will start downloading necessary dependencies). Once project synced successfully then run command again from command line.

  4. react-native run-android

When Project sync failed

  1. See console and Follow steps

  2. Error can be remove min sdk version / install latest gradle dependencies / migrate project to Android X / or any other error(in this case will have to post error here or you can find on stackoverflow)

  3. If above steps too fails you can follow this step in given link Failed to run jetifier

Hope it helps :)

Tarun
  • 1,192
  • 2
  • 11
  • 20
0

Run react-native start ( and don't cancel it ) Then run react-native run-android in another tab of the terminal, ( make sure you are in same directory )

kvadityaaz
  • 1,441
  • 1
  • 16
  • 23
  • start command throws port 8081 already in use, then use --port= 8091 option, then got loading dependency graph done, but doesn't say that it completed... then the other cmd terminal, i run run-android, same results it justsaying forward-jetify, using 4 worker' – Vikas Pandey Aug 23 '19 at 11:30
  • try running `adb reverse tcp:8081 tcp:8081` then `react-native start` @VikasPandey – kvadityaaz Aug 23 '19 at 12:10
0
react-native run-android start --port=8088

This really worked like a charm. Although I did try doing this in the powershell as well

Set-ExecutionPolicy -Scope LocalMachine Unrestricted
// didn't work
Kartikey
  • 4,516
  • 4
  • 15
  • 40