解決“NOTE: One or more layouts are missing the layout_width or layout_height attributes.”

佈局無法加載,xml也沒有錯誤,提示NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts

關閉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.bak

啓動Android Studio打開你的項目,問題就解決了

以下是stackoverflow原答案:
The issue is resolved by these changes:

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 folders

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

作者:IT醉貓
來源:CSDN
原文:https://blog.csdn.net/u012833250/article/details/83785298
版權聲明:本文爲博主原創文章,轉載請附上博文鏈接!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章