I’ve got big nasty error message recently when trying to build app. This happened after Windows crash (Insider build, ha ha).
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: java.io.IOException: java.util.concurrent.ExecutionException: java.io.UncheckedIOException: java.io.IOException: The file or directory is corrupted and unreadable
Here is full Gradle console output: https://pastebin.com/ri58vYN7
What I already tried:
Delete /.gradle directory
Delete app/build directory
Invalidate caches / restart
Clean project, rebuild project
What can I do about it? Is the only way to start new project?
The crash should be a good sign for you to start learning and using a version control like git and start using Linux.
Usually, after Windows crash, one or more of your files in your project got corrupted. Sometimes the file becomes blank or contains cryptic text which the Gradle can't read and process. You need to check each file inside your project and fix it.
You must cherish the problems because it happens when you starting a new project. Start using version control or you will lost your precious time and project when Windows crash again.
Afaik, crash is a feature of Windows.
Related
enter image description here
What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
java.nio.file.FileSystemException: D:\Course\Flutter_Projects\dating_app\build\app\intermediates\merged_java_res\debug\out.jar: The process cannot access the file because it is being used by another process.
If you are doing this from an IDE, try simple clean builds or invalidate the cache option found in Intellij IDE's. Try closing the Android Studio completely as well (surprisingly solves some times).
If you have a git folder, you might also try git clean -fdX.
this is my very first post, Big Deal to me, appreciate your help Colleagues.
I recently updated Android Studio, (this is why I don't like updating) it forced me to create a new gradle file it called Hello ESE.gradle (ESE being the Company's name), the file simple contains this :
group = "itet"
version = "1"
the updating placed this file in the res/values directory when I built, this caused an error saying the file needed to end in .xml,
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
/Users/lokeke/AndroidStudioProjects/CalorieCountdownAppforAndroidBrown/app/src/main/res/values/Hello ESE.gradle: Error: The file name must end with .xml
I thought a gradle does not belong in the values directory so I removed it and put in the build directory but now the errors are even worse, I moved this Hello ESE.gradle to other places where gradle could look for it but still nothing works it won't build, don't know what to do now (how I wish I could go back to pre-update!!!)
I just simply updated all the tools I was using, Gradle, SDK, the works, and transferred to the Hello gradle file to the gradle.properties directory, this seems to have fixed it.
I have browsed several topics surrounding this subject but none are quite recent and maybe someone else can help me. If I clean my project or even try to rebuild it a continuously get an error that says
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:clean'.
> Unable to delete directory 'K:\Android\DementiaApp\app\build'
Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory.
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example\seansandroid\myApp\Games
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example\seansandroid\myApp
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example\seansandroid
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com\example
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0\com
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug\0
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder\debug
- K:\Android\DementiaApp\app\build\intermediates\transforms\dexBuilder
- K:\Android\DementiaApp\app\build\intermediates\transforms
- K:\Android\DementiaApp\app\build\intermediates
The file in question is the intermediates. I have seen a lot of people say that you just need to delete this file. For some reason, even if I try to delete the intermediates, they just wont delete! Can anyone help me? This is really annoying.
I'll post the solution to my own question because its worked for me and may help others in the future.
No matter what, my file would not allow me to delete it, regardless of administrative privileges.
By renaming the file, Android Studio identified the file as 'missing' and regenerated another build file. This then allowed me to rebuild and clean my project.
It now works again!
I receive this message when I clean or build my project on android studio
Error:Execution failed for task ':app:clean'.
Unable to delete directory: C:\bt\CatedralVerano\app\build\outputs\apk
I search on severals post and nothing work
I tried to delete the directory and I receive an error message with this code
Error 0x80070570
The file or directory is corrupted and unreadable.
Solutions?
Can you go into task manager and kill any running java or jvm running in the background then try clean again. Should work.
I am not able to figure out why this error is coming
Here is full error
Error:Execution failed for task
':app:transformClassesWithMultidexlistForDebugAndroidTest'.
> java.io.IOException: The output jar is empty. Did you specify the proper
'-keep' options?
My gradle android project was not having "androidTest" so I created manually and test folder here is screenshot of folder structure
I would not consider it as perfect answer but this is what i did.
I removed testInstrumentationRunner="android.support.test.runner....." from build.gradle file and restarted
It starts working :)
It is just for information