Android Wear (Maven):找不到与给定名称匹配的资源:attr 'android:windowSwipeToDismiss'

Android Wear (Maven): No resource found that matches the given name: attr 'android:windowSwipeToDismiss'

我在 Android Studio 中构建了一个 Android Wear 应用程序,但现在决定使用 Maven 构建它。在 Android Studio 中构建时没有编译错误。但是现在,我在使用 Maven 构建时遇到以下错误:

[INFO] [path-to-project]\target\unpacked-libs\com.google.android.support_wearable_aar_1.0.0\res\values\values.xml:127: error: Error: No resource found that matches the given name: attr 'android:windowSwipeToDismiss'. 
[ERROR] Error when generating sources.

以下是我使用的依赖项:

<!-- Android -->
<dependency>
    <groupId>android</groupId>
    <artifactId>android</artifactId>
    <version>4.4W.2_r2</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.android.support</groupId>
    <artifactId>support-v13</artifactId>
    <version>21.0.0</version>
    <type>aar</type>
    <exclusions>
        <exclusion>
            <groupId>com.android.support</groupId>
            <artifactId>support-v4</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<!-- /Android -->

<!-- Android Wear Support -->
<dependency>
    <groupId>com.google.android.gms</groupId>
    <artifactId>play-services-wearable</artifactId>
    <version>7.0.0</version>
    <type>aar</type>
</dependency>

<dependency>
    <groupId>com.android.support</groupId>
    <artifactId>support-v4</artifactId>
    <version>22.0.0</version>
    <type>aar</type>
</dependency>

<dependency>
    <groupId>com.google.android.support</groupId>
    <artifactId>wearable</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
    <exclusions>
        <exclusion>
            <groupId>com.android.support</groupId>
            <artifactId>recyclerview-v7</artifactId>
        </exclusion>
        <exclusion>
            <groupId>com.android.support</groupId>
            <artifactId>support-v4</artifactId>
        </exclusion>
    </exclusions>
</dependency>

显然android:windowSwipeToDismiss无法识别。我注意到这个属性是在 API 20 级左右添加的。但是在我的 Manifest.xml 中目标设置为 21。感谢您的帮助!

问题是由于 Maven 插件的 SDK 版本。发生错误是因为 sdk 版本是在 Android 资源插件而不是 AMP(拼写错误)中声明的。