I had successfully imported a Module in my Application project in Android Studio. Then I deleted or removed the module by following the below link:
Module
Android Studio
If you still see the error after removing the code from settings.gradle and the app gradle file, check the following file and remove any entries with the module name you are trying to remove.
settings.gradle
./.idea/modules.xml