首先描述一下问题,我的问题是因为打包上线后,可能因为加固的原因,具体我出现的问题,暂时没搞清楚。

布局无法加载,xml也没有错误,提示NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts

解决“NOTE: One or more layouts are missing the layout_width or layout_height attributes.”
我出现的问题

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

然后各种资源错误一堆,然后我的百度找了半天,也没发现,最后还是找到了,还好时间不算太长1个多小时,记得抓重点搜索,才有可能搜到,所以我发现了最关键的地方那就是下面这个图片:

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

 

我出现错误的图片找不到了,给大家发个解决完成的提示图吧!

如果符合以上错误,那么直接看下面的操作!

 

关闭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.
 

最后转下原文地址 https://blog.csdn.net/u012833250/article/details/83785298

相关文章:

  • 2021-04-05
  • 2021-05-04
  • 2021-05-25
  • 2021-04-08
  • 2022-12-23
  • 2021-07-27
猜你喜欢
  • 2021-10-11
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-09-23
相关资源
相似解决方案