错误:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:

时间:2018-03-23 17:10:20

标签: xml android-studio

我设计的GridLayout忘了在cardView中添加gradle

后来我添加了这个

implementation 'com.android.support:cardview-v7:26.1.0'

build.gradle(module:app)

然后点击

Sync Now

在此之后我的代码gridLayout出错了 我点击修复它的第一个选项... 我无法撤消,我也有2 xml content_maincontent_main(v14)

及以下是错误的错误

  

C:\ Users \ AndroidStudioProjects \ ShoppingApp \ app \ src \ main \ res \ layout \ app_bar_main.xml错误:错误:资源布局/ content_main(aka com.example.shoppingapp:layout / content_main)未找到。   错误:找不到资源布局/ content_main(aka com.example.shoppingapp:layout / content_main)。   错误:链接文件资源失败。   错误:java.util.concurrent.ExecutionException:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息   错误:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息   错误:com.android.tools.aapt2.Aapt2Exception:AAPT2错误:检查日志以获取详细信息   错误:任务':app:processDebugResources'的执行失败。

     

无法执行aapt

这是我的xml代码

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
android:orientation="vertical"
android:background=""
android:weightSum="10"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.shoppingapp.MainActivity"
tools:showIn="@layout/app_bar_main">

<RelativeLayout
    android:layout_weight="1"
    android:layout_width="match_parent"
    android:background="#1A237E"
    android:layout_height="0dp">

    <TextView
        android:id="@+id/title"
        android:text="Online Shopping"
        android:textSize="25dp"
        android:layout_centerInParent="true"
        android:textColor="#00BCD4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</RelativeLayout>

<GridLayout
    android:columnCount="2"
    android:rowCount="2"
    android:alignmentMode="alignMargins"
    android:columnOrderPreserved="false"
    android:layout_weight="9"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:padding="12dp">

    <!-- Row 1 -->
    <!-- Column 1-->

</GridLayout>
</LinearLayout>

0 个答案:

没有答案