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
java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file C:\Users\AGRIT.gradle\caches\jars-9\2f0317f12d54d6c10096ba1dbae69156\tink-1.3.0-rc2.jar.
at makeError (E:\reactnative\bookNorder_wo_expo\node_modules\execa\index.js:174:9)
at E:\reactnative\bookNorder_wo_expo\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (E:\reactnative\bookNorder_wo_expo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (E:\reactnative\bookNorder_wo_expo\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
Version
0.69.3
Output of npx react-native info
ystem:
OS: Windows 10 10.0.19044
CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Memory: 1.17 GB / 7.91 GB
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.5.4 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 2021.1.0.0 AI-211.7628.21.2111.8193401
Visual Studio: Not Found
Languages:
Java: 11.0.13
npmPackages:
@react-native-community/cli: Not Found
react: 18.0.0 => 18.0.0
react-native: 0.69.3 => 0.69.3
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
npx react-native init AwesomeProject
npm run android
Snack, code example, screenshot, or link to a repository
"resource": "/E:/reactnative/bookNorder_wo_expo/android/",
"owner": "generated_diagnostic_collection_name#1",
"code": "0",
"severity": 8,
"message": "The supplied phased action failed with an exception.\r\nA problem occurred configuring root project 'bookNorder_wo_expo'.\r\njava.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file C:\Users\AGRIT\.gradle\caches\jars-9\2f0317f12d54d6c10096ba1dbae69156\tink-1.3.0-rc2.jar.\r\norg.gradle.api.GradleException: Failed to create Jar file C:\Users\AGRIT\.gradle\caches\jars-9\2f0317f12d54d6c10096ba1dbae69156\tink-1.3.0-rc2.jar.\r\nFailed to create Jar file C:\Users\AGRIT\.gradle\caches\jars-9\2f0317f12d54d6c10096ba1dbae69156\tink-1.3.0-rc2.jar.\r\nFailed to process the entry 'com/google/crypto/tink/proto/HmacParams$Builder.class' from 'C:\Users\AGRIT\.gradle\caches\modules-2\files-2.1\com.google.crypto.tink\tink\1.3.0-rc2\c7efb1ecc3b667b8a0789a1b019b06269037e19b\tink-1.3.0-rc2.jar'\r\nData error (cyclic redundancy check)",
"source": "Java",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 1,
"endColumn": 1
Build Error with
Build Error with Android | React-native-gradle-plugin broken | Crypto tink library issue
Jul 28, 2022
The error logs leads to the following repository/library, https://mvnrepository.com/artifact/com.google.crypto.tink/tink-android which is the same error I found while upgrading to new architecture.
And hence these are managed by this new react-native-gradle-plugin, it has some bugs into it or maybe some other reason
That folder is around 5GB in size. I don't want to disturb my other work environment and projects which are working fine.
@cortinico Will that action be fine?
@cortinico I did delete that folder but it lead me to new error in this new project
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
6 actionable tasks: 2 executed, 4 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'bookNorder_wo_expo'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file C:\Users\AGRIT\.gradle\caches\jars-9\2f0317f12d54d6c10096ba1dbae69156\tink-1.3.0-rc2.jar.
* 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 4m 2s
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 root project 'bookNorder_wo_expo'.
> java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file C:\Users\AGRIT\.gradle\caches\jars-9\2f0317f12d54d6c10096ba1dbae69156\tink-1.3.0-rc2.jar.
* 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 4m 2s
at makeError (E:\reactnative\bookNorder_wo_expo\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at E:\reactnative\bookNorder_wo_expo\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:\reactnative\bookNorder_wo_expo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (E:\reactnative\bookNorder_wo_expo\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
and my other project is also having an error now
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'planbttr'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not download tink-1.3.0-rc2.jar (com.google.crypto.tink:tink:1.3.0-rc2)
> Could not get resource 'https://jcenter.bintray.com/com/google/crypto/tink/tink/1.3.0-rc2/tink-1.3.0-rc2.jar'.
> java.io.IOException: Data error (cyclic redundancy check)
* 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 4m 27s
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 root project 'planbttr'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not download tink-1.3.0-rc2.jar (com.google.crypto.tink:tink:1.3.0-rc2)
> Could not get resource 'https://jcenter.bintray.com/com/google/crypto/tink/tink/1.3.0-rc2/tink-1.3.0-rc2.jar'.
> java.io.IOException: Data error (cyclic redundancy check)
* 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 4m 27s
at makeError (E:\Work\april 10\pb_userModule\reactnative_ui\node_modules\execa\index.js:174:9)
at E:\Work\april 10\pb_userModule\reactnative_ui\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (E:\Work\april 10\pb_userModule\reactnative_ui\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (E:\Work\april 10\pb_userModule\reactnative_ui\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
Would need some direction to solve this, please!
@leotm As I refer to this issue from your P.R. React native is not compatible with openJDK 18 and mine is
openjdk version "11.0.13" 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode)
This issue clears doubt against my jdk version.
Needhelp1
have you checked your npx react-native info and java --version matches our 0.69 docs?
https://reactnative.dev/docs/environment-setup mentioned and linked in the error msg
if all setup correct, have you tried to repro after a fresh git clean -fdx in your project?
if still happening, i agree with @cortinico and would clean your Windows Gradle cache as he suggested
rm -rf ~/.gradle has fixed Gradle caching issues for me in the past on macOS
(i'm don't do React Native work on Windows, macOS and Linux are enough 😆)
if still happening after that, could you link us to a minimal repro starting from npx react-native init AwesomeProject?
Please, use the following command.
npx react-native init AwesomeProject
It will install new packages for react-native cli (In my case, [email protected])
Then, npx react-native run-android, again.
It worked on my computer.