渲染问题注:一个或多个布局缺少layout_width或layout_height属性.这些在大多数布局中都是必需的
我在Android中有一个项目,一切正常,那么当我昨天打开项目时,这一直给我这个错误
I have a project in Android and everything is okay then when i open the project yesterday this kept giving me this error
渲染问题
注意:一个或多个布局缺少layout_width或layout_height属性.在大多数布局中,这些都是必需的.
属性可见性"中的不可见"不是有效的整数(未显示109个类似错误)
提示:尝试刷新布局.
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>
这些更改已解决了该问题:
The issue is resolved by these changes:
-
关闭Android Studio
Close Android Studio
转到C:\ Users \ UserName.android并将build-cache文件夹重命名为buildcache.bak
Go to C:\Users\UserName.android and rename the build-cache folder to buildcache.bak
转到C:\ Users \ UserName.AndroidStudio3.2 \ system并重命名这些文件夹
Go to C:\Users\UserName.AndroidStudio3.2\system and rename these folders
(1)缓存到caches.bak
(2)将编译器转换为compile.bak
(3)编译服务器到compile-server.bak
(4)转换为conversion.bak
(5)external_build_system到external_build_system.bak
(6)从框架到frameworks.bak
(7)从gradle到gradle.bak
(8)resource_folder_cache到resource_folder_cache.bak
(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
打开Android Studio,然后再次打开您的项目.
Open the Android Studio and open your project again.