You must supply a layout_width attribute Solution

Source: Internet
Author: User

Today, the Project reported the following problem:

Java. lang. runtimeexception: unable to start activity componentinfo {COM. CSII. jincheng/COM. CSII. UI. mainmenuactivity}: Java. lang. runtimeexception: Binary XML file line #1: You must supply a layout_height attribute.

This probably means that no corresponding attribute is added to the XML layout file. I have encountered a similar problem before and think this is not a problem at all, the attribute in XML must have been written or not written, or the attribute is not supported. I will troubleshoot it one by one through the above steps;

Step 1: Check whether there are missing attributes in the layout file corresponding to this class. All attributes are complete. Is there a problem;

Step 2: Check whether the style referenced by the layout file is correct;

Step 3: check if there are any attributes that are not supported. This is too far away and cannot be found;

The problem is that the test machine is not around yet. In the local project team, there is no clue. The more time it gets, the more calm it gets, check the problem again. When the problem occurs, it is a Motorola mobile phone. I don't know the model. All of the above are excluded. Check the layout file corresponding to this category, let's take a look at what attributes are used. I finally found that this file has a fixed width value. I thought it was a problem with adaptation. Finally, I found that the adaptation values did not adapt to the corresponding resolution, in addition, there is no Demin in the default values. XML file, and finally add the corresponding file to solve this problem;

You must supply a layout_width attribute Solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.