Eve
Eve

Reputation: 1238

Android studio suddenly shows full folder names, how to change

Android Studio suddenly shows the full name a folder in the Project view and I don't know how to change it. I tried to change the view with the settings in the option menu in the Project view (flatten packages check/uncheck, compact empty middle packages check/uncheck), but it didn't change.

This is how my project view used to look like:

enter image description here

This is how it looks now:

enter image description here

It seems to me that every folder inside the myapp folder suddenly has the full appid + its own name as foldername. I tried resetting Android Studio settings by using these commands (I'm a mac user):

rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*

Still no changes. My current Android Studio version is Android Studio 2.2, build number AI-145.3276617.

The only thing I did was to update to the latest stable Android 2.2 version yesterday, I don't know if this changed the way the app appears, another project (the how it used to be screenshot) didn't seem affected at all.

Upvotes: 10

Views: 3364

Answers (5)

Check the "Compact Middle Packages" option in project

Upvotes: 0

Ace
Ace

Reputation: 2228

I had the same issue, tried all of the above, and other suggestions by other SO answers. I also had everything up to date. No luck.

However, my problem originated from a specific - messy - action I made.
I was working with a library that I (imported through/was downloaded by) gradle (as a compile only dependency).

For x reasons, I moved the sources folder around a lot, and I ended up placing it in the root of my project (next to folders like app, build, etc). After realizing the sources themselves were linked to other dependencies, I just deleted them.
Android Studio took note of each path I moved the sources to, and when it couldn't find it in the last one, this problem arose.

SOLUTION
In this folder (/.idea/libraries), I found a reference xml file for the poorly implemented library, among other references:

<SOURCES>
  <!-- paths I moved the sources to -->
  <root url="..wrong path.." />
  <root url="..wrong path.." />
  ..
  <!-- legit path created by gradle -->
  <root url=".. some temp folder .." />
</SOURCES>

Inside the xml, I removed the aforementioned paths Android Studio took note of, rebuilt the project and bam, problem solved!

Upvotes: 0

Mavamaarten
Mavamaarten

Reputation: 2039

This seems to be an issue with the newest stable 2.2 build. I reported the issue here, no response yet: https://code.google.com/p/android/issues/detail?id=223389

Upvotes: 4

Madhukar Hebbar
Madhukar Hebbar

Reputation: 3183

Uncheck Flattern packages

enter image description here

under setting. enter image description here

Upvotes: 10

Pier Giorgio Misley
Pier Giorgio Misley

Reputation: 5351

Referring to this answer

This should be what you did:

Click on the settings icon of the Project toolbar and turn off Compact Empty Middle Package.

So you only need to turn it on again

Hope it helps

Upvotes: 0

Related Questions