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

The following worked for me:

  1. Go to Build.gradle(Module: app) and enable make databinding => enable :false.
  2. Rebuild your project.

./gradlew assembleDebug --rerun-tasks

This command run in the command prompt will work if you are trying to connect multiple code bases using settings.gradle and get this error.


I had encountered the similar error in Android Studio. I just invalidated the cache and restarted the IDE. I suppose it has some thing to do with stale cache data which do not get updated during build processes. Thus, when you undo some changes which previously resulted in creation and deletion of packages and classes, like DataBinding classes in Android Studio. You are left with directories which do not exist and IDE never updated the caches to reflect the same in following builds. Thus, even if after cleaning and rebuilding, error persist. Hope this helps.

In Android Studio, goto FILE -> Invalidate Cache and Restart.