Missing attributes in the layout design - Android Studio

牧云@^-^@ 提交于 2019-11-28 01:38:21

问题


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

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).


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?


回答1:


Solution (Extracted from here)

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

    • caches

    • compiler

    • compile-server

    • conversion

    • external_build_system

    • frameworks

    • resource_folder_cache

  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.

Suggestions are working as well.



来源:https://stackoverflow.com/questions/54843163/missing-attributes-in-the-layout-design-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!