首页 > 解决方案 > 'android:required' 未找到

问题描述

每次我想构建/清理/重建我的应用程序时,我都会收到以下错误消息。

error: attribute 'android:requiered' not found.

Message{kind=ERROR, text=error: attribute 'android:requiered' not found., sources=[C:\Users\M\AndroidStudioProjects\MyFirstApp\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:11], original message=, tool name=Optional.of(AAPT)}

我很困惑,因为我的 manifest.xml 有需要的代码:

<?xml version="1.0" encoding="utf-8"?>

<uses-feature
    android:name="android.hardware.camera"
    android:requiered="true"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

在此处输入图像描述

标签: android

解决方案


这是一个错字。正确的写法是android:required


推荐阅读