react-native-reanimated: Android Build failed Task :react-native-reanimated:downloadBoost FAILED

Description

After Adding react-native-reanimated library in React Native 0.70.0 we are getting below issue in Window 10:

error Failed to launch emulator. Reason: Emulator exited before boot..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
Starting a Gradle Daemon, 3 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Configure project :react-native-reanimated
Native libs debug enabled: false
Android gradle plugin: 7.2.1
Gradle: 7.5.1
building Reanimated2
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.

> Task :react-native-reanimated:downloadHermes UP-TO-DATE
Download https://github.com/facebook/hermes/tarball/hermes-2022-08-16-RNv0.70.0-716d48baf36b0b326ab82f53207b8682c87fc017

> Task :react-native-reanimated:downloadDoubleConversion UP-TO-DATE
Download https://github.com/google/double-conversion/archive/v1.1.6.tar.gz

> Task :react-native-reanimated:downloadBoost
Download https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz

> Task :react-native-reanimated:downloadFolly UP-TO-DATE
Download https://github.com/facebook/folly/archive/v2021.07.22.00.tar.gz

> Task :react-native-reanimated:downloadGlog UP-TO-DATE
Download https://github.com/google/glog/archive/v0.3.5.tar.gz

> Task :react-native-reanimated:downloadBoost FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
376 actionable tasks: 4 executed, 372 up-to-date

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.        
-----------
* What went wrong:
Execution failed for task ':react-native-reanimated:downloadBoost'.
> A failure occurred while executing de.undercouch.gradle.tasks.download.internal.DefaultWorkerExecutorHelper$DefaultWorkAction
   > java.net.SocketException: Connection reset

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 59s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-reanimated:downloadBoost'.
> A failure occurred while executing de.undercouch.gradle.tasks.download.internal.DefaultWorkerExecutorHelper$DefaultWorkAction
   > java.net.SocketException: Connection reset

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 59s

    at makeError (E:\SHWP\shwa-mobile\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
    at E:\SHWP\shwa-mobile\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (E:\SHWP\shwa-mobile\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (E:\SHWP\shwa-mobile\node_mo
`

I am struggling with the issue from past 2 days. Still not able to find the any solution. I have tried with cache clean. Invalidated Cache and Restart in Android Studio but still we are facing above see. Please check the screenshot for more details:

image_2022_09_29T11_55_37_507Z

See OS configuration:

image_2022_09_30T05_11_24_794Z

Thanks

Steps to reproduce

  1. add below library in the project
  2. npm install @react-navigation/drawer
  3. npm install react-native-gesture-handler react-native-reanimated

Snack or a link to a repository

https://github.com/react-navigation/react-navigation

Reanimated version

2.10.0

React Native version

0.70.0

Platforms

Android

JavaScript runtime

No response

Workflow

No response

Architecture

No response

Build type

No response

Device

No response

Device model

No response

Acknowledgements

Yes

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (8 by maintainers)

Most upvoted comments

This is happening for latest version 3.1.0 as well. Is there a fix?

This is how I solve it

RN 0.70.0 Previously i was using “react-native-reanimated”: " 3.0.0", each and every time when I want to build my RN app it took like 4hrs then failed issue of network.

The solution for me was to lower it to “react-native-reanimated”: “2.11.0”,

@piaskowyk Recently, my work has been in a hurry and I don’t have time. I will provide it in a while thanks

It’s happening again in react-native-reanimated version 3.0.2.

Build errors are at follow:


info Opening the app on Android...
info JS server already running.
info Launching emulator...
info Installing the app...
> Task :react-native-gradle-plugin:compileKotlin
> Task :react-native-gradle-plugin:compileJava NO-SOURCE
> Task :react-native-gradle-plugin:pluginDescriptors
> Task :react-native-gradle-plugin:processResources
> Task :react-native-gradle-plugin:classes
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC
> Task :react-native-gradle-plugin:jar

> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.3.1
Gradle: 7.5.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
5 actionable tasks: 5 executed

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/macbook/myanmar-cyber-youths/alpha-learn/apps/mobile/android/local.properties'.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/macbook/myanmar-cyber-youths/alpha-learn/apps/mobile/android/local.properties'.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

    at makeError (/Users/macbook/myanmar-cyber-youths/alpha-learn/apps/mobile/node_modules/execa/index.js:174:9)
    at /Users/macbook/myanmar-cyber-youths/alpha-learn/apps/mobile/node_modules/execa/index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (/Users/macbook/myanmar-cyber-youths/alpha-learn/apps/mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:82:7)
    at async Command.handleAction (/Users/macbook/myanmar-cyber-youths/alpha-learn/apps/mobile/node_modules/@react-native-community/cli/build/index.js:108:9)
info Run CLI with --verbose flag for more details.
q
:
q

✨  Done in 30.38s.
➜  mobile git:(main) ✗
➜  mobile git:(main) ✗
➜  mobile git:(main) ✗
➜  mobile git:(main) ✗ nvim package.json
➜  mobile git:(main) ✗



^ moved to #3680, closing this issue as 2.11.0 no longer downloads Boost.

I have the same problem I cant build the app with any network connection every time in every build, when the terminal arrived in task: react-native-reanimated:downloadBoost its stopped and exited from the terminal

@tomekzaw

it seems this problem was happen in last 10 days 😦 because I could run my react-native app in 2weeks ago