Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
425 views
in Technique[技术] by (71.8m points)

android - 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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The issue is resolved by these changes:

  1. Close Android Studio

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

  3. Go to C:UsersUserName.AndroidStudio3.2system 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...