首页 > 解决方案 > “这个项目包含资源错误,所以aapt没有成功,会导致渲染失败,先修复资源问题。” 在安卓工作室

问题描述

块引用

我是 Android Studio 的新手,我创建了一个程序并遇到资源错误,请帮我解决这个问题。

它显示错误“此项目包含资源错误,因此aapt没有成功,这可能导致渲染失败。首先修复资源问题。

请帮我解决这个问题。

代码:

 <?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:gravity="center_horizontal"


        tools:context=".MainActivity">
    <!-- Display whether Bluetooth is avilable or not-->
       <TextView

           android:id="@+id/statusBluetoothTv"

           android:layout_width="match_parent"
           android:layout_height="14dp"
           android:minWidth=""
           android:text=" "

           android:textAlignment="center"
           android:textColor="#000"
           android:textSize="20sp" />

        <!--Bluetooth icon (on/off)-->

        <ImageView

            android:id="@+id/bluetoothIv"
            android:layout_width="100dp"
            android:layout_height="100dp"
        <Button

            android:id="@+id/onBtn"
            android:minWidth="200dp"

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Turn On"
            style="@style/Base.Widget.AppCompat.Button.Colored" />

        <!--off btn-->
        <Button

            android:id="@+id/offBtn"
            android:minWidth="200dp"

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Turn Off"
            style="@style/Base.Widget.AppCompat.Button.Colored" />

        <!--Discoverable Button-->
        <Button

            android:id="@+id/DiscoverableBtn"
            android:minWidth="200dp"

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Discover devices"
            style="@style/Base.Widget.AppCompat.Button.Colored" />

        <!--Get list of Paired devices button-->

        <Button

            android:id="@+id/pairedBtn"
            android:minWidth="200dp"

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Get paired Devices"
            style="@style/Base.Widget.AppCompat.Button.Colored" />

        <!--show paired devices here-->

       <TextView
           android:id="@+id/pairedTv"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:minWidth="200dp"
           android:text=""
           android:textColor="#000" />

标签: androidandroid-studioresources

解决方案


推荐阅读