question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doubled packager for start:ios & start:android?

See original GitHub issue

Hey team,

Every time I run either yarn start:android or yarn start:ios I get two packager launched:

screen shot 2017-11-06 at 9 31 35 am

The line being executed is: concurrently -r 'react-native start' 'react-native run-android' It seems to me that react-native run-X starts its own packager, so we don’t really need to concurrently react-native start

It’s been the case since I started contributing on GitPoint, and since no one complained about so far, I’m wondering if you guys are also experiencing this, or if it’s only affecting me… 🤔

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
machourcommented, Nov 7, 2017

@chinesedfan no problems at all. Added some console.log() statement in both files, here’s what’s happening:

screen shot 2017-11-07 at 10 20 11 am

As you can see, the fetch() completed quickly with “not_running”, so runAndroid starts a new one. (the one it starts is opened in the white window). Immediately after this first test fails, the packager supposed to be started by “react-native start” is finally up & running, so the new packager fails.

If I add for (var i = 0; i < 10000000000000; i++) {} in runAndroid before the isPackagerReady() test is executed, the double popup disappears. This is because by the time the fetch() is done, our first packager is already up and running.

1reaction
chinesedfancommented, Nov 6, 2017

@machour I don’t think it has relationship with global react-native. My global react-native is linked to a strange place. Let’s talk in gitter. 😃

[zhong@localhost git-point]$ react-native --version
Looks like you installed react-native globally, maybe you meant react-native-cli?
To fix the issue, run:
npm uninstall -g react-native
npm install -g react-native-cli
[zhong@localhost git-point]$ ll `which react-native`
lrwxr-xr-x  1 zhong  admin  98  9  6 22:32 /usr/local/bin/react-native -> ../../../Users/zhong/.config/yarn/global/node_modules/react-native/local-cli/wrong-react-native.js
Read more comments on GitHub >

github_iconTop Results From Across the Web

App Startup - Android Developers
The App Startup library provides a straightforward, performant way to initialize components at application startup.
Read more >
About Android App Bundles
Google Play uses your app bundle to generate and serve optimized APKs for each device configuration, so only the code and resources that...
Read more >
App startup time - Android Developers
This document provides information to help you optimize your app's launch time. It begins by explaining the internals of the launch process.
Read more >
Use test doubles in Android - Android Developers
On Android, you can use the Robolectric framework, which provides a special type of test double. Robolectric lets you run your tests on...
Read more >
Multi-window support - Android Developers
On Android 12L (API level 32) and higher, the flag enables apps to activate split-screen mode and start activities in an adjacent window....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found