The specified project directory ''" does not exist
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.
If you are using IntelliJ with Gradle, you may need to unlink a non-existent module in the Gradle tab.