Android Wear模块中的“意外的名称空间前缀“ app””

时间:2018-12-07 22:04:33

标签: android android-wear-data-api android-wear-complication

我添加了一个基于on this Google doc的新的Android Wear模块

但是出现标题中描述的错误。这是我的布局。

<?xml version="1.0" encoding="utf-8"?>
<android.support.wear.widget.BoxInsetLayout 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:background="@color/dark_grey"
    android:padding="@dimen/box_inset_layout_padding"
    tools:context=".MainWearActivity"
    tools:deviceIds="wear">  

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="@dimen/inner_frame_layout_padding"
        app:boxedEdges="all">  <---this is the offending line 

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/hello_world" />

    </FrameLayout>
</android.support.wear.widget.BoxInsetLayout>

任何人都知道发生了什么事吗?感谢您对我为什么收到此错误的解释。 更新:我删除了多余的android前缀。 Android Studio要求我更改应用程序前缀以更改为android,但即使这样做,错误仍然存​​在。现在是安全的时间来假设它是一个错误吗?

1 个答案:

答案 0 :(得分:4)

根据Mike M的建议,我右键单击该错误,然后在Android Studio中选择了抑制。我的框架布局现在看起来像这样。但是,我目前不知道是什么原因引起的。

<FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="@dimen/inner_frame_layout_padding"
        app:boxedEdges="all"
        tools:ignore="MissingPrefix">

这似乎暂时可行。