Android: layout layout page can not be displayed, prompt: one or more layouts are missing the layout_width or layout_height attrib…

Error message: one or more layouts are missing the layout_width or layout_height attributes

The reason for the error: I currently understand that the page layout does not match

Solution 1: Modify the screen size of the xml display, try a few more times.

Solution 2:

The layout cannot be loaded and the xml has no errors, prompting NOTE: One or more layouts are missing the layout_width or layout_height attributes. these are required in most layouts

Close Android Studio
Go to C:\Users\UserName\ .android directory, rename build-cache to buildcache.bak
Go to C:\Users\UserName\ .AndroidStudio3.2\system directory
(1) caches rename to caches.bak
(2) compiler rename to compiler.bak
(3) compile-server renamed to compile-server.bak
(4) conversion renamed to conversion.bak
(5) external_build_system rename to external_build_system.bak
(6) frameworks rename to frameworks.bak
(7) gradle rename to gradle.bak
(8) resource_folder_cache rename to resource_folder_cache.bak

Start Android Studio and open your project, the problem is solved

 

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.

Similar Posts: