Why is an app module from a different project showing up in my current project in Android Studio?

1k Views Asked by At

Screenshot

Please check the above screenshot for a better understanding of my problem.

The app module of another app that I was working on showed up in my current app and I'm not sure how to get rid of it.

Both apps were created using flutter and I had opened the Android folder to build the apk but whenever I'm doing this the first error I'm getting is,
Project 'firebase_auth' not found in root project 'android'.
firebase_auth is used in the previous application and not current one and it is forcing me to add all the same dependencies.
Even after I've done that it doesn't even recognize my current app module and only runs the previous app

UPDATE-1: I changed the directory of my previous app and now it seems to be searching for it, I'm getting this error:
The specified project directory 'C:\Users\thear\FlutterProjects\xxxxx\android' does not exist.
That is the old directory of my previous app

UPDATE-2: Changing the directory and detaching the Gradle project of the previous app helps but I still don't understand why my project is looking for the previous project, what is connecting the two.

1

There are 1 best solutions below

3
On BEST ANSWER

The easiest solution for this is to:

  1. Close the project
  2. Go to the $project_folder\android\.idea folder
  3. Delete modules.xml and workspace.xml files
  4. Open the android folder again in Android Studio, the modules loads correctly.

I am not sure why this happens but deleting those configuration files solved my problems with the wrong modules loading.