Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IllegalArgumentException: Parameter 'directory' is not a directory in android

Tags:

java

android

I rebuilt my project and got this error. I'm unable to find where it's coming from. The full log is:

Caused by: java.lang.IllegalArgumentException: Parameter 'directory' is not a directory
    at org.apache.commons.io.FileUtils.validateListFilesParameters(FileUtils.java:545)
    at org.apache.commons.io.FileUtils.listFiles(FileUtils.java:521)
    at android.databinding.tool.store.ResourceBundle.loadClassInfoFromFolder(ResourceBundle.java:157)
    at android.databinding.tool.store.LayoutInfoInput$deps$2.invoke(LayoutInfoInput.kt:63)
    at android.databinding.tool.store.LayoutInfoInput$deps$2.invoke(LayoutInfoInput.kt:30)
    at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:154)
    at android.databinding.tool.store.LayoutInfoInput.getDeps(LayoutInfoInput.kt)
    at android.databinding.tool.store.LayoutInfoInput$existingBindingClasses$2.invoke(LayoutInfoInput.kt:86)
    at android.databinding.tool.store.LayoutInfoInput$existingBindingClasses$2.invoke(LayoutInfoInput.kt:30)
    at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:154)
    at android.databinding.tool.store.LayoutInfoInput.getExistingBindingClasses(LayoutInfoInput.kt)
    at android.databinding.tool.BaseDataBinder.<init>(BaseDataBinder.kt:40)
    at com.android.build.gradle.internal.tasks.databinding.DataBindingGenBaseClassesTask$CodeGenerator.run(DataBindingGenBaseClassesTask.kt:203)
    at com.android.build.gradle.internal.tasks.databinding.DataBindingGenBaseClassesTask.writeBaseClasses(DataBindingGenBaseClassesTask.kt:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
    at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)
    ... 33 more

Help would be appreciated!

like image 499
Vijay Singh Avatar asked Jan 03 '19 07:01

Vijay Singh


1 Answers

I've had the same problem. All I did was:

  1. Delete the .gradle directory
  2. Invalidate Caches and restart Android Studio.
like image 116
Doilio Matsinhe Avatar answered Oct 17 '22 16:10

Doilio Matsinhe