報錯信息:one or more layouts are missing the layout_width or layout_height attributesandroid
錯誤緣由:目前我理解的是頁面佈局不匹配佈局
解決方法一:修改一下xml顯示的屏幕大小,屢次幾回。gradle
解決方法二:看到大神【IT醉貓】的文章,感受不錯,在這裏添加一下ui
佈局沒法加載,xml也沒有錯誤,提示NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts.net
關閉Android Studio
進入C:\Users\UserName\ .android目錄,將build-cache重命名爲buildcache.bak
進入C:\Users\UserName\ .AndroidStudio3.2\system 目錄
(1) caches 重命名爲 caches.bak
(2) compiler 重命名爲 compiler.bak
(3) compile-server 重命名爲 compile-server.bak
(4) conversion 重命名爲 conversion.bak
(5) external_build_system 重命名爲 external_build_system.bak
(6) frameworks 重命名爲 frameworks.bak
(7) gradle 重命名爲 gradle.bak
(8) resource_folder_cache 重命名爲 resource_folder_cache.bakserver
啓動Android Studio打開你的項目,問題就解決了xml
如下是stackoverflow原答案:
The issue is resolved by these changes:blog
Close Android Studio
Go to C:\Users\UserName.android and rename the build-cache folder to buildcache.bak
Go to C:\Users\UserName.AndroidStudio3.2\system and rename these foldersget
(1) caches to caches.bak
(2) compiler to compiler.bak
(3) compile-server to compile-server.bak
(4) conversion to conversion.bak
(5) external_build_system to external_build_system.bak
(6) frameworks to frameworks.bak
(7) gradle to gradle.bak
(8) resource_folder_cache to resource_folder_cache.bak頁面佈局
Open the Android Studio and open your project again.原文連接:https://blog.csdn.net/u012833250/article/details/83785298