Android studio: Parameter 'directory' is not a directory - android

When I try to build my project, I get such a mistake:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dataBindingGenBaseClassesDebug'.
> Parameter 'directory' is not a directory

From an answer to a similar question:
Delete the .gradle directory (in the project base directory)
Invalidate Caches and restart Android Studio (if necessary)
EDIT: Step 2 doesn't appear necessary on *nix systems

Related

Build Failed with an an exception

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.

The specified project directory ''" does not exist

Ever since I have upgraded my Android Studio 3.0.1 to 3.1 I am not able to run the project.
Executing task 'assemble'..
FAILURE: Build failed with an exception.
* What went wrong:
The specified project directory '' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 0s
The specified project directory '' does not exist.
15:52:35: Task execution finished 'assemble'.
If you are using IntelliJ with Gradle, you may need to unlink a non-existent module in the Gradle tab.
The issue might also be caused by an empty 'Gradle project:' field under:
'Run'
-> 'Edit Configurations...'
-> 'Gradle'
-> 'NAME OF YOUR CONFIGURATION'
-> 'Configuration'
-> 'Gradle project:'
Filling out this field by selecting the root directory of my application (an clicking on 'Apply') resolved the issue for me.
Delete .idea and .gradle folders and try to re-import the project. I had refactored my project name and I ran into the issue and deleting .idea and .gradle folders and re importing worked as it clears the meta data of project configuration for intellij or android studio.
Navigate to "File" and select "Invalidate Caches and Restart" from the drop down. After Android Studio restarts, your project should run.
have same issue
I copy an already existing project and try to run it and got this error
I fix it by
Enter to the settings.gradle file and change the "rootProject.name" to my new project name
If this not the issue than
2) from left side press on Gradle
press on project that failed to build and remove it
maybe you will need to restart the intelij after

Execution failed for task dexBuilderForDebug

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.

Android studio BUILD FAILED In my Application shows error java.io.IOException: Could not delete path

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithProfilers-transformForDebug'.
> java.io.IOException: Could not delete path
Myapplication\app\build\intermediates\transforms\profilers-transform\debug\jars\1\10\226ac48e5c8c6b8707c7d76c6056e5800dee24de.jar'
I have use android studio 2.4.
please suggest solution regarding above issue,thanks in advance!
Try deleting the directory or the file manually.
I guess some of the files in the target build directory is open in another tool you use. Just a file handle open in the folder which has to be cleaned. The build task 'clean' wants to delete all the files in the build directory(normally 'target') and when it fails, the build fails.
I had the same error, tried deleting the directory It didn't work. So this is what I did. I just copied all my project files except the "Build folder and "Build Folder" in App to a new directory and I opened the project from the new directory and it worked perfectly.

Gradle build not executing because it can't find cache.properties

My gradle build in android Studio is failing because it can't access the cache.properties file. I have tried invalidating all caches and retrying but that did not work. I also reinstalled all the SDK tools. Here is the error I'm getting
Error:java.io.FileNotFoundException: C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified)
C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified)
Blockquote
Any advice on what to do, here is the complete console output:
FAILURE: Build failed with an exception.
* What went wrong:
java.io.FileNotFoundException: C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified)
C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (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.
BUILD FAILED
Total time: 0.747 secs
delete gradle folder, quit Android Studio and Start again fixed this problem for me
run cmd
write %temp%
then temp folder open delete all file in temp then rebuild your project
hope this will solve your problem
After Search i found this answer and worked for me
thanks to #Salam El-Banna and #Naveed Ahmad
You don't have to delete all .gradle folders and no need to reinstall Android Studio.
I have the latest version of Android Studio and I faced that problem, the only thing that worked for me is to:
1- Navigate to
C:\Users\user.gradle\caches\2.x\
2- Copy the folder scripts , scripts-remapped and paste it somewhere safe just in case anything went wrong you will place it back
3- Delete this folder scripts and scripts-remapped from the directory C:\Users\user.gradle\caches\2.x\
4- Sync Project with Gradle Files and you are done.
When you sync your project Android Studio will generate new cache files.
It worked for me I hope it will work for you.
reference:
Cache.properties (The system cannot find the file specified)
Delete your Gradle folder
Invalidate cache and Restart
Simply these steps fix your issue.

Categories

Resources