-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI is slower to start Android apps (taking around 7.5 seconds) on react-native run-android
#38270
Comments
|
Having the same issue on 0.72.1. Updated from 0.67.5, and after update app gets stuck a long time between "info Starting JS server..." and "info Installing the app..." with no other output. Can't therefore see what's causing the delay, but our app is quite complex and this delay takes 2-3 minutes on an M1 Mac. Delay even worse on other devices. It also happens if the JS server is already up when starting the app, so that can be ruled out as the cause. |
Facing same issue 😢 |
Does the same issue happens on a empty app? |
@cortinico the delay is definitely smaller in that case, but still slower than previous versions. It does seem the more libraries/complexity, the larger the delay. If there are any tests you want me to run I'm happy to do so, it's just unfortunate there's no output to figure out what might be causing the delay. |
@rodrigo-nexudus thanks for the clarification.
|
@cortinico I'm already running 0.72.1, the issue persists. As for Hermes, I've just tried disabling it through gradle.properties and it does not seem to have made a difference. I also added some logging directly to build.gradle, both at the top of the file and when the hermesEnabled boolean is accessed. Both logs displayed on console after the delay, when the app begins "installing", so seems like whatever is happening is prior to any build.gradle access. On the screenshot above, the "Accessing build.gradle" log was added as the first line of build.grade, and "false" is the value of hermesEnabled, printed just before the check in dependencies. The delay is between "info JS server already running..." and "info Installing the app..." |
Ah ok so it's not part of the runtime but is a CLI issue. I believe I noticed this delay as well. Don't you mind opening this same issue here: https://github.com/react-native-community/cli/issues As this is most likely an issue with the CLI (cc @thymikee @szymonrybczak) |
react-native run-android
This was fixed and released in |
Can we have an ETA on the next React Native patch to fix this issue @cortinico ? |
Hey @rodrigo-nexudus, it'll be released with next React Native patch ( |
@szymonrybczak do you have any kind of ETA on the patch? Sorry to ask, but this issue adds several minutes every time we have to build the app for implementation/debugging purposes, and we use native code quite a bit within our app, which means it's pretty common for us to have to rebuild things. Thanks in advance! |
@szymonrybczak just tested with RN 0.72.4, confirming running the latest cli version, but its still hangs :/ |
Related issue added in React Native CLI, I've also confirmed that this has not been fixed there. |
I am still waiting for the fixes. any updates here? |
More updates here. Looks like it's related to React Native CLI running |
@rodrigo-nexudus we created fix for this inside CLI, we'll release patch fix for React Native 0.72 in the nearest future. |
Description
Android is taking around 7.5 seconds on startup.
React Native Version
0.71.8
Output of
npx react-native info
System:
OS: macOS 11.7.7
CPU: (8) x64 Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
Memory: 431.39 MB / 16.00 GB
Shell:
version: 3.2.57
path: /bin/bash
Binaries:
Node:
version: 16.15.1
path: /usr/local/bin/node
Yarn:
version: 1.22.11
path: ~/node_modules/.bin/yarn
npm:
version: 8.11.0
path: /usr/local/bin/npm
Watchman:
version: 2023.05.22.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 21.2
- iOS 15.2
- macOS 12.1
- tvOS 15.2
- watchOS 8.3
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode:
version: 13.2.1/13C100
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.14.1
path: /usr/bin/javac
Ruby:
version: 2.7.5
path: /Users/macbook/.rvm/rubies/ruby-2.7.5/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.1
wanted: 0.72.1
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
Steps to reproduce
I just upgraded the project to 0.71.8 and after upgrading the app is taking time to start.
Snack, code example, screenshot, or link to a repository
Package.json file
android/build.gradle
android/app/build.gradle
The text was updated successfully, but these errors were encountered: