Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Unexpected namespace prefix "app"' in Android wear module

I added a new android wear module based on this Google doc

but I am getting the error described in the title. Here is my layout.

<?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>

Anyone know what's going on? I appreciate explanation as to why I am getting this error. UPDATE: I removed the redundant android prefix. Android studio requires me to change the app prefix to change to android but even after doing so the error remains. Is it safe time to assume it is a bug?

like image 646
The_Martian Avatar asked Dec 07 '18 22:12

The_Martian


1 Answers

Based on what Mike M suggested, I right clicked on the error and I selected suppress in Android studio. My Framelayout now looks like this. I do not however currently know what caused the warning.

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

This seems to work for now.

like image 175
The_Martian Avatar answered Nov 10 '22 17:11

The_Martian