11

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>
rbcastro17
  • 197
  • 1
  • 3
  • 13

6 Answers6

28

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.

Community
  • 1
  • 1
gourav singhal
  • 677
  • 7
  • 10
9

This issues is caused in newer versions of android studio 3.2 you can fix the error by deleting the cache files. step 1 : close android studio. step 2: Go to .AndroidStudio3.2->system->caches. step 3: Delete all files. step 4: open Android studio

babin raj
  • 163
  • 2
  • 10
0

Your template is corrupted. Just go file and then setting. On the top search box, search templates and find file and code template. Choose that then choose other tab at the right hand side. click android and click layoutResourcesFile.xml. copy and paste the below code on it and make sure you click live templates.

<?xml version="1.0" encoding="utf-8"?>
<${ROOT_TAG} xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="${LAYOUT_WIDTH}"
             android:layout_height="${LAYOUT_HEIGHT}">

</${ROOT_TAG}>
TeoPeiShen
  • 43
  • 1
  • 7
0

I also got this error. I was helped by the following:

Remove the Android Studio files

To delete any remains of Android Studio setting files, in File Explorer, go to your user folder (%USERPROFILE%), and delete .android, .AndroidStudio and any analogous directories with versions on the end, i.e. .AndroidStudio1.2, as well as .gradle and .m2 if they exist.

The source is here

But I have not deleted these folders. I removed the dots in the folder name. After that, I launched Android Studio. She suggested that I export the settings from the old folders (in which I removed the dots in the title). I refused and re-tuned the studio. After that I opened the project and everything works. Sorry for my english. I hope you understand my answer :)

0

The only thing that worked for me. 1. Download Android studio from the official website https://developer.android.com/studio/#downloads. 2. Install You can even import settings from the previos install. Now the render is fixed

Jack
  • 1,545
  • 2
  • 11
  • 20
0

I used the simple feature of Clean Project (Build -> Clean Project) and it somehow worked for me!