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:
Remove compile project(':module_name') from build.gradle under app folder
then remove module folder under your Project Folder
then remove your module name entry from settings.gradle
This worked for me:
In app/build.gradle
, remove this line from dependencies {
:
implementation project(':library')
In settings.gradle
, change
include ':app', ':library'
to
include ':app'
Then you can import the library. Be sure to put the lines back into the gradle files you took out above.
I solved this by removing the existing module from the project structure, then renaming the folder. It finally worked when I removed the folder, ran a sync, then re-added the folder and attempted to import.
If somebody faces this issue, except removing the Folder containing the old module also remove from the settings.gradle
file the line corresponding to the old module: include ':youroldmodule'
. If you dont remove that line manually, 2 modules with the same name will appear when trying to add module dependency.
If shows this error after deleting the module from project structure then, select Project view of our project in android studio and then explore and the there will be the folder of module that we imported, right click on that and Delete it and rebuild the app.
The project view on the left hand side, doesn't show 'everything' your project contains. You can switch the view from the drop-down menu, which is defaulted to 'Android' and change it to 'Project Files', which will probably show you where the problematic reference to the Module remains.
Alternatively, just check on disk where your project is located. I found references in the main project folder.