react-native: React native run android terribly slow

I have a decent working laptop here. But the build speed seems to be intolerable to me. It takes me around 3 minutes for a debug mode build in android and 7 minutes for release mode build in android for my application. Was it a matter related to certain release of react-native or nodejs? Or what exactly causes the slow build?

The app does not have hermes/proguard enabled. It’s the similar timing despite i build on simulator/real device.

At least it doesn’t seem “OK” for me. 3 minutes compilation is already long and 7 minutes compilation is very ridiculous to me.

Note: Mind to share what build time u all use as well?

1) npx react-native run-android (takes 3 minutes)
2) npx react-native run-android --variant=release (takes 7 minutes)

React Native version: System: OS: Windows 10 10.0.18363 CPU: (8) x64 Intel® Core™ i7-8650U CPU @ 1.90GHz Memory: 15.41 GB / 31.88 GB Binaries: Node: 12.9.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.10.2 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.5.0.0 AI-191.8026.42.35.6010548 npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.5 => 0.61.5

Steps To Reproduce

  1. npx react-native run-android (takes 3 minutes)
  2. npx react-native run-android --variant=release (takes 7 minutes)

Describe what you expected to happen:

  • Expect to takes around 1-2 minutes at most

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 32
  • Comments: 21 (1 by maintainers)

Most upvoted comments

Hlo sir i have new problem now i want to store screenshot of ViewShot of react native in mobile ,i am using function approach insted of class please help me . please its my college project please help me .

Thank You for replying me have a great night.

On Tue, 29 Sep, 2020, 7:58 pm Olli Rytkönen, notifications@github.com wrote:

<============-> 99% EXECUTING [27m 16s]

Transforming artifact jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2) with JetifyTransform Transforming artifact lifecycle-livedata-2.0.0.aar (androidx.lifecycle:lifecycle-livedata:2.0.0) with JetifyTransform Transforming artifact appcompat-resources-1.1.0.aar (androidx.appcompat:appcompat-resources:1.1.0) with AarToClassTran Transforming artifact vectordrawable-animated-1.1.0.aar (androidx.vectordrawable:vectordrawable-animated:1.1.0) with A Transforming artifact fragment-1.1.0.aar (androidx.fragment:fragment:1.1.0) with AarToClassTransform Transforming artifact viewpager-1.0.0.aar (androidx.viewpager:viewpager:1.0.0) with JetifyTransform PS C:\Users\nites\MyApp> npx react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using “–no-jetifier” flag. Jetifier found 967 file(s) to forward-jetify. Using 8 workers… info JS server already running. info Installing the app…

Task :app:stripDebugDebugSymbols UP-TO-DATE Compatible side by side NDK version was not found. <============-> 99% EXECUTING [10m 17s] IDLE IDLE IDLE :app:installDebug IDLE IDLE IDLE IDLE

see this its take too long time and there is no answer please help me

I think its normal for the first time you build your app that it takes some time. Mine takes 10-20 minutes at the first build.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/facebook/react-native/issues/27898#issuecomment-700743335, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARD46LQGRLMOPJE35XNMEFLSIHVKXANCNFSM4KNJ5SYA .

I managed to fix this by following these instructions: https://onesignal.com/blog/android-migrate-jcenter-to-maven-central/

<============-> 99% EXECUTING [27m 16s]

Transforming artifact jsr305-3.0.2.jar (com.google.code.findbugs:jsr305:3.0.2) with JetifyTransform Transforming artifact lifecycle-livedata-2.0.0.aar (androidx.lifecycle:lifecycle-livedata:2.0.0) with JetifyTransform
Transforming artifact appcompat-resources-1.1.0.aar (androidx.appcompat:appcompat-resources:1.1.0) with AarToClassTran Transforming artifact vectordrawable-animated-1.1.0.aar (androidx.vectordrawable:vectordrawable-animated:1.1.0) with A Transforming artifact fragment-1.1.0.aar (androidx.fragment:fragment:1.1.0) with AarToClassTransform Transforming artifact viewpager-1.0.0.aar (androidx.viewpager:viewpager:1.0.0) with JetifyTransform PS C:\Users\nites\MyApp> npx react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using “–no-jetifier” flag. Jetifier found 967 file(s) to forward-jetify. Using 8 workers… info JS server already running. info Installing the app…

Task :app:stripDebugDebugSymbols UP-TO-DATE Compatible side by side NDK version was not found. <============-> 99% EXECUTING [10m 17s] IDLE IDLE IDLE :app:installDebug IDLE IDLE IDLE IDLE

see this its take too long time and there is no answer please help me

Hi,

I am also facing same issue. Two days I spent to solve this issue in different ways . Kindly someone help me that how to reduce the app deployment time (which takes 1 hr 55 mins) in Android. 1hr

Thank you.

am having this issue, npx react-native run-android --verbose --no-jetifier takes a tremendous amount of time to compile and expo start is fucking up with mixed port (can’t use it either) 😦

@gromanas What block does this go in inside build.gradle, and I’m guessing you mean android/build.gradle?

On a Mac pro and for our project it takes almost 10 min for a release build on android with react 0.61.4 and on debug it takes only 1min and 30 sec