Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio 2.2.3: Favorites, bookmarks and opened folders keep disappearing, project and .idea-folder are always rebuilt

I'm trying to use favorites and bookmarks with Android Studio 2.2.3 on Windows 7 in order to navigate through our code base.

I have openend one project, where the saving of favourites and bookmarks works fine. BUT when I open another project, while my first project is open as well and then close one of the 2 projects, the closed project loses all the favorites, bookmarks and which folders and tabs I had opened.

Also AS keeps asking me to add the VCS root everytime I start it.

Although I've searched I could not find any sources describing my problem.

I've copied all my projects into a new folder and gave myself all permissions to this folder, which did not fix my problem, so I think permissions are not the problem.

My assumption was, that Android Studio might have trouble if you use multiple instances.

So I went and tried to set it to only use one window:

ProjectOpen

But this setting keeps getting ignored and AS opens a new window for every project.

I reset all the settings for Android Studio by removing the folder C:\<username>\.AndroidStudio2.2.

Then I re-started Android Studio and didnt import any new settings.

With this configuration my problem still occurred.

In order to reproduce the 'bug' do this:

  • Open a project by File -> Open (NOT File -> Open recent!)
  • Add bookmarks
  • Open another project (while the first project is still open!) by File -> Open
  • Add bookmarks there as well
  • Close project 1 and re-open project 1 by File -> Open

All tabs / bookmarks / favorites should be gone at this point.

Vadim Kotov has confirmed that the problem happens with his Android Studio as well, so I suspect a bug in AS.

How can I fix the disappearing favorites, bookmarks, opened folders and tabs?

like image 505
hamena314 Avatar asked Jan 12 '17 14:01

hamena314


1 Answers

This problem seems to be a rather old bug in Android Studio:

https://code.google.com/p/android/issues/detail?id=172347

The bug is fixed in the Android Studio 2.3 BETA-release:

https://code.google.com/p/android/issues/detail?id=232670&thanks=232670&ts=1485023505

Basically Android Studio seems to overwrite the workspace.xml in the .idea-folder for a project with a default - workspace.xml everytime I use the Open - menu.

AS probably re-creates the whole .idea-folder and rebuilds the project, everytime I use the File -> Open-dialog.

Workaround:

Since I cant switch to another version of Android Studio due to company rules, I use the following workaround:

  • When you want to open a project for the first time, you have to use File -> Open
  • After that, ONLY use File -> Open recent in order to get into one of your projects

This will save the opened tabs, bookmarks, favorites and will open only one instance of AS in the forground instead of the background.

WARNING!

If you later click on File -> Open either because the recent-menu is filled too much, or you do it by accident, you still probably will lose your bookmarks, favorites etc...

like image 185
hamena314 Avatar answered Oct 14 '22 18:10

hamena314