DEV Community

Omar Jaber
Omar Jaber

Posted on

React Native Android Build Takes More Than 2 Hours

Hello everyone, I am developing my first React Native app using the React Native CLI, and I did not use Expo.

Yesterday, I started building the Android version of the app.

The build process ran for over two hours without ever finishing.

No clear error messages appeared at any point;

the process simply kept running.

I am not sure if I made a mistake in my operations, or if this is a common issue with Gradle. Has anyone else encountered this situation? What generally causes builds to be this slow? Are there any check items or positioning methods to troubleshoot the stuck build process? I would really appreciate any guidance you can offer. Thank you!

Top comments (1)

Collapse
 
mockcher profile image
Bastian Böhme

Hi @dev_omar24, that could be nearly anything, would be great if you can share the log of the build console.

Some thoughts:

  • did you run npm run android , npx react-native run-android or some sort of gradlew assamble* from android folder?
  • which react native version did you use?

During gradle, downloading the gradle files can take a long time espacially if you have a slow internet connection.
An issue I had myself: I had defined allProject { repositories { ... }} twice which lead to running the whole dependency fetch twice. Once fast and than again but most dependencies couldn't be fetched because the second one didn't include mavenCentral() or google()

But again, posting the console output and providing some context of the tech you used would help a lot.