1

I'm running Android Studio 3.1.1 on OSx and I have three projects that all use the same local library projects / modules.

My problem is that Android Studio often opens the wrong project when I open one of those 3 projects. Let's say I open Project 2 or Project 3, then I might find that Project 1 is the project that is actually opened, even though it displays the correct path for all three in the "Welcome to Android Studio" dialog.

The solution I've been resorting to until now is to

  1. Remove all three projects from the "Welcome to Android Studio" dialog project list
  2. Go into all three project folders, removing the .iml file
  3. Importing the projects back into Android Studio using the "Import project" function

I'm getting really tired of this, and it's really confusing to think that you have opened one project but another one opens instead.

What could be causing this very strange behaviour?

Magnus
  • 17,157
  • 19
  • 104
  • 189
  • I have the same problem. I notice workspace.xml in the .idea directory seems to reference other projects. This issue is a huge nuisance for me. – Red wine Sep 08 '19 at 00:03

2 Answers2

0

Sometime android_studio is catching the old cache, to solve this go file , hit invalidate cache and restart. And the second solution is, you have to Refactor the package name, every project should have the unique package name in this situation. i hope this will help...

0

https://developers.google.com/android/guides/google-services-plugin go to this official link. It solved me this problem. In my case, ] deleted saved file in this path "app/build/generated/res/google-services/{build_type}/values/values.xml" which contains my previous app's information. After that, when I run my current app, it created that file again, but with my current app's info.

Zahra
  • 2,231
  • 3
  • 21
  • 41