Reputation: 19
I am new in react native facing some issues
Starting a Gradle Daemon, 1 busy and 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Task :app:compileDebugJavaWithJavac FAILED 15 actionable tasks: 2 executed, 13 up-to-date
FAILURE: Build failed with an exception.
Could not create service of type DefaultGeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches(). Unexpected lock protocol found in lock file. Expected 3, found 0.
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 21s
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.
Could not create service of type DefaultGeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches(). Unexpected lock protocol found in lock file. Expected 3, found 0.
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 21s
at makeError (C:\Users\RDX\Desktop\AwesomeProject\node_modules\execa\index.js:174:9)
at C:\Users\RDX\Desktop\AwesomeProject\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (C:\Users\RDX\Desktop\AwesomeProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\RDX\Desktop\AwesomeProject\node_modules\@react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
Upvotes: 1
Views: 13353
Reputation: 2246
More information is needed here but you can try the following quick fixes.
Please note that the below terminal commands are based on Mac and Linux operating systems.
Run
npx react-native run-android
after each command below to see which fix works for you.
cd ./android && ./gradlew clean && cd ..
rm -rf ./node_modules
npm install or yarn install
Run this command again,
cd ./android && ./gradlew clean && cd ..
Update distributionUrl on android/gradle/wrapper/gradle-wrapper.properties to,
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
Update gradle tools version on android/build.gradle
buildscript {
...
dependencies {
...
classpath('com.android.tools.build:gradle:4.2.0') // Use this verison
NOTE: Each command above should be executed from the project root folder. If none of these works then please leave a comment!
Upvotes: 2