react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

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

Open pankajnegi1893 opened this issue 2 years ago • 2 comments

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

pankajnegi1893 avatar Sep 30 '22 05:09 pankajnegi1893

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Sep 30 '22 05:09 github-actions[bot]

Hey, java.net.SocketException: Connection reset suggests that there is some kind of connection problem when downloading Boost from server. Please try building the project again.

Also, this issue is specific to Reanimated 2.10. In a general case, Reanimated v2 should not download binaries from network. We plan to release 2.11 next week which should also resolve this problem.

tomekzaw avatar Sep 30 '22 06:09 tomekzaw

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

fkazemi5236 avatar Oct 12 '22 11:10 fkazemi5236

Hey, java.net.SocketException: Connection reset suggests that there is some kind of connection problem when downloading Boost from server. Please try building the project again.

Also, this issue is specific to Reanimated 2.10. In a general case, Reanimated v2 should not download binaries from network. We plan to release 2.11 next week which should also resolve this problem.

@tomekzaw still library not updated. we are struggling with this issue. we are not able to run the application.

pankajnegi1893 avatar Oct 13 '22 07:10 pankajnegi1893

@fkazemi5236 @pankajnegi1893 You know you can still use 2.9.1, right? You can also upgrade to 3.0.0-rc.3 if you don't use Reanimated 1 API.

tomekzaw avatar Oct 13 '22 07:10 tomekzaw

so we should install "yarn add [email protected]"? like this?

fkazemi5236 avatar Oct 13 '22 07:10 fkazemi5236

Yes.

tomekzaw avatar Oct 13 '22 07:10 tomekzaw

@fkazemi5236 @pankajnegi1893 We have just published 2.11.0: https://www.npmjs.com/package/react-native-reanimated/v/2.11.0

tomekzaw avatar Oct 13 '22 17:10 tomekzaw

@tomekzaw

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':react-native-reanimated:classpath'.
      > Could not find com.android.tools.build:gradle:7.3.0.
        Searched in the following locations:
          - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom
          - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom
          - https://plugins.gradle.org/m2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom
        Required by:
            project :react-native-reanimated

* 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 16s

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 failed with an exception.

* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':react-native-reanimated:classpath'.
      > Could not find com.android.tools.build:gradle:7.3.0.
        Searched in the following locations:
          - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom
          - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom
          - https://plugins.gradle.org/m2/com/android/tools/build/gradle/7.3.0/gradle-7.3.0.pom
        Required by:
            project :react-native-reanimated

* 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 16s

    at makeError (D:\diet_mobile_app\node_modules\execa\index.js:174:9)
    at D:\diet_mobile_app\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (D:\diet_mobile_app\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (D:\diet_mobile_app\node_modules\@react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

fkazemi5236 avatar Oct 15 '22 10:10 fkazemi5236

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

tomekzaw avatar Oct 18 '22 11:10 tomekzaw

thanks a lot @tomekzaw my problem was solved 😎

fkazemi5236 avatar Oct 19 '22 06:10 fkazemi5236

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",

mavine4512 avatar Mar 14 '23 20:03 mavine4512

RN 0.70.0 still happen!!! 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.

urtheone avatar Apr 10 '23 06:04 urtheone

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) ✗



theaungmyatmoe avatar Apr 21 '23 17:04 theaungmyatmoe

它在react-native-reanimated版本中再次发生3.1.0。

构建错误如下:

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) ✗

yujunfan avatar May 05 '23 09:05 yujunfan

我在3.1.0版本中也遇到了构建失败

luckyGTL avatar May 10 '23 12:05 luckyGTL

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

ali-wesdigital avatar May 17 '23 07:05 ali-wesdigital

@ali-wesdigital Which React Native version do you use? Do you want to build it on Windows or MacOS?

piaskowyk avatar May 17 '23 12:05 piaskowyk

Has anyone solved this problem yet ? "react-native-reanimated": "^2.9.1", "react-native": "0.64.0", There is still this problem

luojiong avatar May 22 '23 11:05 luojiong

@luojiong Could you provide me a reproduction? I am not able to reproduce this issue on my current setup.

piaskowyk avatar May 22 '23 12:05 piaskowyk

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

luojiong avatar May 22 '23 12:05 luojiong

It's happening on my Mac too what op do you use?

theaungmyatmoe avatar May 22 '23 14:05 theaungmyatmoe

@luojiong Sure! Thanks for your time!

piaskowyk avatar May 23 '23 07:05 piaskowyk

不能把 boost 放在本地进行引用吗

yxwandroid avatar Aug 03 '23 03:08 yxwandroid

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",

This works for me! Thanks.

chamaldesilva avatar Aug 09 '23 18:08 chamaldesilva

having the same issue with 3.4.2 :( anyone found a solution?

renatomserra avatar Aug 29 '23 09:08 renatomserra

EDIT: might be intermittent issue, does not work on 2.17.0 either. Will update later! Im getting this on 3.4.2, think I must revert to 2.17.0 again. EDIT2 (a day later): Might be related to classpath("de.undercouch:gradle-download-task:5.0.1") in the projects build.gradle under buildscript -> dependencies block. Newest version classpath("de.undercouch:gradle-download-task:5.5.0") seems to work sometimes. Can also be timeouts caused by CPU hikes. EDIT3: It seemed to have been caused by high CPU spikes from indexing the current git repo. Read more here how to exclude your git repo from indexing (for example when you clean node_modules/android build etc). https://apple.stackexchange.com/questions/144474/mds-and-mds-stores-constantly-consuming-cpu

> Task :react-native-reanimated:downloadFolly FAILED
546 actionable tasks: 6 executed, 540 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-reanimated:downloadFolly'.
> A failure occurred while executing de.undercouch.gradle.tasks.download.internal.DefaultWorkerExecutorHelper$DefaultWorkAction
   > de.undercouch.gradle.tasks.download.org.apache.hc.client5.http.ConnectTimeoutException: Connect to https://github.com:443 [github.com/140.82.121.4] failed: connect timed out

eisodev avatar Sep 07 '23 14:09 eisodev