【发布时间】:2018-10-24 19:15:36
【问题描述】:
今天我刚刚更新了我的 android studio...因为我在 xml 文件中遇到了更多错误
AGPBI: {"kind":"error","text":"error: 属性
\u0027android:contentScrim\u0027 未找到。","来源": [{"file":"C:\Users\priya\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main6.xml","position":{"startLine":12}}],"original" :"","tool":"AAPT"} AGPBI: {"kind":"error","text":"error: \u0027attr/actionBarSize\u0027 与属性 android:layout_height (attr) 不兼容 维度|枚举 [fill_parent\u003d4294967295, match_parent\u003d4294967295, wrap_content\u003d4294967294].","sources":[{"file":"C:\Users\priya\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main6.xml","position":{" startLine":22}}],"original":"","tool":"AAPT"} AGPBI: {"kind":"error","text":"error: 属性 \u0027android:srcCompact\u0027 不是 找到。","sources":[{"file":"C:\Users\priya\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main6.xml","position":{"startLine": 61}}],"original":"","tool":"AAPT"} AGPBI: {"kind":"error","text":"error: 属性 \u0027android:srcCompact\u0027 不是 找到。","sources":[{"file":"C:\Users\priya\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main6.xml","position":{"startLine": 99}}],"original":"","tool":"AAPT"} AGPBI: {"kind":"error","text":"error: 属性 \u0027android:srcCompact\u0027 不是 找到。","sources":[{"file":"C:\Users\priya\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main6.xml","position":{"startLine": 144}}],"原始":"","工具":"AAPT"} AGPBI: {"kind":"error","text":"error: 属性 \u0027android:srcCompact\u0027 不是 找到。","sources":[{"file":"C:\Users\priya\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main6.xml","position":{"startLine": 182}}],"原始":"","工具":"AAPT"} AGPBI: {"kind":"error","text":"error: 属性 \u0027android:srcCompact\u0027 不是 找到。","sources":[{"file":"C:\Users\priya\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main6.xml","position":{"startLine": 227}}],"原始":"","工具":"AAPT"}FAILURE:构建失败并出现异常。
-
出了什么问题: 任务 ':app:processDebugResources' 执行失败。
处理资源失败,详见上面的 aapt 输出。
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
29 秒后构建失败
我试图纠正它,但我不能......任何人都知道这个......谢谢
这是我的活动
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.kara.kavin.myapplication.Main6Activity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="300dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collasingtoolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="exitUntilCollapsed|scroll"
android:contentScrim="?attr/colorPrimary"
app:title="NEAT Patrol"
app:expandedTitleMarginStart="48dp"
app:expandedTitleMarginEnd="64dp"
android:background="@drawable/sam">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbarid"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_collapseMode="pin"
android:layout_width="match_parent"
android:layout_height="attr/actionBarSize"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp"
android:background="#fcfcfc"
android:gravity="center"
android:id="@+id/ll">
<LinearLayout
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:id="@+id/bankcardId"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/cerclebackgroundpurple"
android:srcCompact="@drawable/ic_attach_money_black_24dp"
android:padding="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:text="Banking"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/lightgray"
android:layout_margin="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Check your bank activities"
android:padding="5dp"
android:textColor="@android:color/darker_gray"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/cerclebackgroundpink"
android:srcCompact="@drawable/ic_lightbulb_outline_black_24dp"
android:padding="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:text="Ideas"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/lightgray"
android:layout_margin="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Check your bank activities"
android:padding="5dp"
android:textColor="@android:color/darker_gray"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/cerclebackgroundgreen"
android:srcCompact="@drawable/ic_control_point_black_24dp"
android:padding="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:text="Add"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/lightgray"
android:layout_margin="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Check your bank activities"
android:padding="5dp"
android:textColor="@android:color/darker_gray"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:layout_width="160dp"
android:layout_height="190dp"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/cerclebackgroundyello"
android:padding="10dp"
android:srcCompact="@drawable/ic_attach_file_black_24dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="Links"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_margin="10dp"
android:background="@color/lightgray" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:text="Check your bank activities"
android:textColor="@android:color/darker_gray" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:clipToPadding="false"
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.CardView
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
android:layout_width="340dp"
android:layout_height="150dp"
android:layout_margin="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
android:background="@drawable/cerclebackgroundpurple"
android:srcCompact="@drawable/ic_wifi_black_24dp"
android:padding="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_marginTop="10dp"
android:text="Add"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/lightgray"
android:layout_margin="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Check your bank activities"
android:padding="5dp"
android:textColor="@android:color/darker_gray"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
【问题讨论】:
-
添加activity_main6.xml文件