Missing attributes in the layout design - Android Studio
Asked Answered
M

2

5

A lot of attributes are missing in the Attributes panel in the layout designing window.

enter image description here

As you can see in the above image, only two attributes are shown for Buttons. Even no suggestions are given in the Text view (XML).

enter image description here


Following are my project and Android Studio configurations.

Current Version : Android Studio 3.3.1
Build number : AI-182.5107.16.33.5264788
Gradle Version : 4.10.1

Gradle : Project

dependencies {
    classpath 'com.android.tools.build:gradle:3.3.1'
    classpath 'com.google.gms:google-services:4.2.0'
}

I've tried

File -> Invalidate Caches / Restart... -> Invalidate Caches and Restart

but it didn't work. What am I missing?

Mertz answered 23/2, 2019 at 15:32 Comment(6)
Just to make sure - do you click on your button before looking for attributes?Wald
@TamirAbutbul Yes I did. You can see that the button is highlighted in the Component tree in the first image.Mertz
Ye just wanted to make sure, I know that you did Invalidate Caches / Restart but could you exit android studio and reopen it? I once had similar problem and by reopening android studio i got it fixedWald
There's nothing to indicate hidden trees or those kinds of issues. The missing autocomplete is also incredibly weird. Does it work with earlier versions?Fp
@TamirAbutbul Yes I also manually closed and opened android studio.Mertz
@Zoe the earlier version of android studio which I had was 3.2.0. In that it worked well, but I upgraded it to 3.3.1 few weeks back and only today I opened the layout editor for the first time after upgrading.Mertz
M
10

Solution (Extracted from here)

  1. Close Android Studio
  2. Go to C:\Users\UserName\.android and delete the build-cache and cache folders
  3. Go to C:\Users\UserName\.AndroidStudioX.X\system and delete these folders

    • caches

    • compiler

    • compile-server

    • conversion

    • external_build_system

    • frameworks

    • resource_folder_cache

    • tmp

  4. Open Android Studio and open your project again.


Android Studio automatically generate several files and folders to store configurations, cache, etc. Above issue happens when Android Studio messes up one or more of these files and folders. Solution is to delete them. So when the previously saved files are no longer available, Android Studio creates those configurations back again.

This won't affect any of your projects or the changes which you have made to Android Studio (Settings, themes, Keymaps, etc.)


All the attributes are now shown as before.

enter image description here

Suggestions are working as well.

enter image description here

Mertz answered 23/2, 2019 at 21:4 Comment(3)
Works in Android Studio 3.5 build #IA-191.8026Abirritant
My issue was similar. Android Studio was unable to show some attributes in "Design View" (e.g. visibility). Cleaning these files helped.Panaggio
Can't find the "C:\Users\UserName\.AndroidStudioX.X\system" equivalent folder on MacOS and I have the same problem. There is no hidden folder in the user directory and doesn't appear in any Library folder or in the Application content bundle. 🤷Categorical
F
0

Close project at Android Stduio. Then delete Android SDK folder (C:/Users/user/appdata/Local/Android/Sdk) completely. Open Android Studio and download Android Sdk. This worked for me.

Futilitarian answered 7/5, 2020 at 20:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.