Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rendering Problems NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts

I have a project in Android and everything is okay then when i open the project yesterday this kept giving me this error

Rendering Problems
NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts.
"invisible" in attribute "visibility" is not a valid integer (109 similar errors not shown)
Tip: Try to refresh the layout.

even when i start a new project and i go to the layout it kept giving me the error.

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:background="@color/backgroundDark"
    tools:context="coalesce.collabup.LoginActivity">

    <!-- Login progress -->
    <ProgressBar
        android:id="@+id/login_progress"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:visibility="gone" />

    <ScrollView
        android:id="@+id/login_form"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/email_login_form"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@+id/Logo"
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:text="CollabUp"
                android:textSize="70sp"
                android:lineSpacingExtra="8sp"
                android:typeface="normal"
                android:textAlignment="center"
                android:textStyle="normal|bold" />
            <TextView
                android:id="@+id/motto"
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:text="Collaboration at its finest"
                android:textStyle="normal|bold"
                android:textAlignment="center"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="50dp" />

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <AutoCompleteTextView
                    android:id="@+id/email"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Email"
                    android:inputType="textEmailAddress"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textSize="18sp"
                    android:padding="10dp"
                    android:layout_marginBottom="10dp" />

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
               >

                <EditText
                    android:id="@+id/password"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Password"
                    android:imeActionId="@+id/login"
                    android:imeActionLabel="Sign In"
                    android:imeOptions="actionUnspecified"
                    android:inputType="textPassword"
                    android:maxLines="1"
                    android:singleLine="true" />

            </android.support.design.widget.TextInputLayout>
<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    >
            <CheckBox
                android:text="keep me log in?"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/checkBox2"
                android:layout_marginTop="10dp" />

            <Button
                android:id="@+id/email_sign_in_button"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp"
                android:text="Sign In"
                android:textStyle="bold"
                android:layout_marginLeft="250dp"
                android:layout_marginBottom="10dp"

                />
</RelativeLayout>
            <TextView
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:id="@+id/registertxt"
                android:text="New to CollabUp? Create an Account now!"
                android:textStyle="normal|bold"
                android:textAlignment="center"
                android:textSize="14sp"
                android:onClick="gotoRegister"
                android:layout_marginBottom="20dp" />

            <TextView
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:id="@+id/forgettxt"
                android:text="Forgot your password?"
                android:textStyle="normal|bold"
                android:textAlignment="center"
                android:onClick="gotoSendForget"
                android:textSize="14sp" />
            <TextView
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:id="@+id/creditstxt"
                android:text="Coalesce 2016 - All rights Reserved - CollabUp"
                android:textStyle="normal|bold"
                android:textColor="@android:color/white"
                android:textAlignment="center"
                android:textSize="14sp"
                android:layout_marginTop="20dp" />
        </LinearLayout>
    </ScrollView>
</LinearLayout>
like image 830
rbcastro17 Avatar asked Feb 27 '17 04:02

rbcastro17


People also ask

What are layout attributes?

Attributes of Layout in Androidandroid:layout_height: It sets the height of the layout. android:layout_width: It sets the width of the layout. android:layout_gravity: It sets the position of the child view. android:layout_marginTop: It sets the margin of the from the top of the layout.

Is it possible to include one layout definition in another?

Reuse layouts with <include> To efficiently reuse complete layouts, you can use the <include> and <merge> tags to embed another layout inside the current layout. Reusing layouts is particularly powerful as it allows you to create reusable complex layouts.

Is the default layout in Android Studio?

The Constraint layout is the default layout used in Android.


1 Answers

The issue is resolved by these changes:

  1. Close Android Studio

  2. Go to C:\Users\UserName.android and rename the build-cache folder to buildcache.bak

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

like image 115
gourav singhal Avatar answered Nov 22 '22 08:11

gourav singhal