怎么解决这个? - “C:\ Users \ dmgop \ AppData \ Local \ Android \ Sdk \ build-tools \ 27.0.3 \ aapt2.exe'中缺少aapt2”

时间:2018-06-10 13:37:29

标签: android android-layout

This is a basic program on android to display 2 texviews and 1 button.

我无法在手机上运行以下代码。以下是在android studio中完成的。

This is my code-
    <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"
        tools:context=".MainActivity">
    <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="QUANTITY"
            />
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="0"
                android:textStyle="bold"
             />
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="ORDER"
            />

[enter image description here

1 个答案:

答案 0 :(得分:0)

看起来你已经损坏了构建工具27.0.3。删除目录C:\Users\dmgop\AppData\Local\Android\Sdk\build-tools\27.0.3\,转到Android Studio中的SDK Manager并重新下载构建工具27.0.3。这应该为您解决问题。