Cannot lock Build Output Cleanup Cache - android

I am having issues with my flutter project. Whenever I run the flutter build apk command. I get the following error message. I tried flutter clean but it does not solve the problem. Here is my error message.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not determine the dependencies of null.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
> Cannot lock Build Output Cleanup Cache (C:\Users\JUSTINE NALWOGA\Desktop\EDUSELF FINAL\eduself\android\.gradle\buildOutputCleanup) as it has already been locked by this process.
* 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 5m 22s
Running Gradle task 'assembleRelease'... 337.9s
Gradle task assembleRelease failed with exit code 1

Try running this command in a terminal,
find ~/.gradle -type f -name "*.lock" -delete
or
Go to /.gradle folder and manually delete all files ending with .lock.
Then run flutter clean,
flutter pub get and finally run
flutter build apk.

Related

React Native Android build issue

I am facing build issue while running "npx react-native run-android" on my windows.
I am stuck with this. Please guide me what I need to do.
I tried following options
deleting .gradle and rebuilding
deleting node-modules and do npm i
deleting androidResources
w: Detected multiple Kotlin daemon sessions at build\kotlin\sessions
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
74 actionable tasks: 45 executed, 29 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> java.io.FileNotFoundException: C:\Users\HP\Desktop\projects\MyEventors\android\app\build\intermediates\incremental\packageDebug\tmp\debug\zip-cache\androidResources (Access is denied)
* 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 55s
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:
Execution failed for task ':app:packageDebug'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> java.io.FileNotFoundException: C:\Users\HP\Desktop\projects\MyEventors\android\app\build\intermediates\incremental\packageDebug\tmp\debug\zip-cache\androidResources (Access is denied)
* 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 55s
at makeError (C:\Users\HP\Desktop\projects\MyEventors\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at C:\Users\HP\Desktop\projects\MyEventors\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\HP\Desktop\projects\MyEventors\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\HP\Desktop\projects\MyEventors\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.```
Try following step
Delete android build folders (both android/build & android/app/build)
Add org.gradle.jvmargs=-Xmx4608m in android/gradle.properties
Delete node_modules
Clean npm / yarn (whichever you are using to install packages) cache by running npm cache clean --force / yarn cache clean
run npm install / yarn to install packages
Android studio -> File -> Invalidate Cache -> Invalidate and Restart
Rebuild the project

Flutter Error. Execution failed for task ':app:processDebugMainManifest'

Hey I want to start learning flutter and I bought a course but when I try to run the auto-generated app I get the following error:
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: E:\Flutter\untitled\build\app\intermediates\navigation_json\debug\navigation.json (The system cannot find the file specified)
* 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 1m 31s
Running Gradle task 'assembleDebug'...
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: E:\Flutter\untitled\build\app\intermediates\navigation_json\debug\navigation.json (The system cannot find the file specified)
* 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 3s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
I saw other people talk about this here but the solution that worked for them didn't work for me.
Here are the things I've tried:
./gralew clean or./gradlew build
/flutter clean
reinstalling flutter and android studio from scratch.
deleting the gradle files and the build files.
switching to another laptop.
I will be very grateful if you guys can help me.
Best Regards,
-Roee Hovav.
Peace!
Open Android Studio make sure you have the latest version installed, and everything is updated then go ahead and open the Flutter project and trying building it from Android Studio
I found the similar error but for me is missing of androidmanifest.xml and I have fixed it
For me I have deleted the android folder and run command "flutter create ."
then I got another of errors about "SdkMinVersion" and "Flutter multidex handling is disabled." and fixed it step by step
Anyway I have found this solution after I have fixed and hope it will help you
--> changing gradle version as the link below
https://github.com/tekartik/sqflite/issues/380

assembleRelease task failed when building a Flutter project

Building with sound null safety
Running Gradle task 'assembleRelease'...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find builder-4.1.0.jar (com.android.tools.build:builder:4.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.1.0/builder-4.1.0.jar
Could not find bundletool-0.14.0.jar (com.android.tools.build:bundletool:0.14.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/bundletool/0.14.0/bundletool-0.14.0.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 6s
Running Gradle task 'assembleRelease'... 10.9s
Gradle task assembleRelease failed with exit code 1
Process finished with exit code 1
Try to build your project with following three steps:
1- flutter build apk --debug
2- flutter build apk --profile
3- flutter build apk --release

Jenkins build fails with error - Exit status of command '/var/../gradlew clean testStoreReleaseUnitTest assembleStoreRelease -p .' was 1 instead of 0

Getting Console Output of Jenkins build error as follow-
Exit status of command '/var/lib/jenkins/workspace/inkMobile-Android_master-YOSIH6EBA55H3BHM...PT7KXE7D7U4DPW6Q/gradlew clean testStoreReleaseUnitTest assembleStoreRelease -p .' was 1 instead of 0.
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory '/var/lib/jenkins/workspace/inkMobile-Android_master-YOSIH6EBA5....PW6Q/C:\androidStudio\sdk' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 8s
I'm building my project on jenkins by clicking Build Now, but in second stage- Build & Test, error comes and build gets fail.
Can someone tell me what this error means?

Cordova build command fails from command Prompt. Task 'cdvBuildDebug' not found in root project 'android'

I am trying to build and generate APK using command prompt. When I used command "cordova build android" for building the project, I am stuck at following issue:
ANDROID_HOME=C:\Phonegap\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
What went wrong:
Task 'cdvBuildDebug' not found in root project 'android'.
BUILD FAILED
Total time: 36.254 secs
Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Task 'cdvBuildDebug' not found in root project 'android'.
Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Can anyone tell me where is this property "cdvBuildDebug" resides and how can i fix this issue?
Try to make build using the phonegap build website .
https://build.phonegap.com/people/sign_in

Categories

Resources