android - “这个项目包含资源错误,所以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" />
解决方案
推荐阅读
- javascript - 图表与水平条不同的 Chart.js 错误
- r - 无法将空间数据帧输出到 .shp
- python - 如何为严重偏斜的样本生成随机数据
- node.js - 多个猫鼬查找相关查询,如何简化为只做一个?
- azure - Azure DevOps Pipeline 测试结果包含重复的测试用例
- c++ - 为什么使用 std::ofstream 进行二进制写入时,std::string.c_str() 不等于 const char*?
- java - 当 for 循环出现无法访问时,有没有办法修复代码?
- node.js - 仅当我使用 Nginx 和通配符添加端口号时,子域才有效
- sql-server - 我应该估计 varbinary 的最大长度,以及如何?
- typescript - 将图像作为填充图案应用到多边形不会改变其样式