布局设计中缺少属性 - Android Studio [英] Missing attributes in the layout design - Android Studio
问题描述
布局设计窗口的属性"面板中缺少很多属性.
如上图所示,Button
只显示了两个属性.甚至在文本视图 (XML) 中也没有给出任何建议.
<小时>
以下是我的项目和 Android Studio 配置.
当前版本:Android Studio 3.3.1内部版本号:AI-182.5107.16.33.5264788摇篮版本:4.10.1
Gradle:项目
依赖项{类路径 'com.android.tools.build:gradle:3.3.1'类路径 'com.google.gms:google-services:4.2.0'}
<小时>
我试过了
文件 ->使缓存无效/重新启动... ->使缓存无效并重新启动
但是没有用.我错过了什么?
解决方案 (摘自
建议也有效.
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 Button
s. 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?
Solution (Extracted from here)
- Close Android Studio
- Go to
C:\Users\UserName\.android
and delete thebuild-cache
andcache
folders Go to
C:\Users\UserName\.AndroidStudioX.X\system
and delete these folderscaches
compiler
compile-server
conversion
external_build_system
frameworks
resource_folder_cache
tmp
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.
这篇关于布局设计中缺少属性 - Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!