0
votes

I am trying to create a BoxInsetLayout and when start to set the FrameLayout, I get an error.

java.lang.NoSuchFieldError: BoxInsetLayout_Layout_boxedEdges at android.support.wear.widget.BoxInsetLayout$LayoutParams.(BoxInsetLayout.java:450) at android.support.wear.widget.BoxInsetLayout.generateLayoutParams(BoxInsetLayout.java:142) at android.support.wear.widget.BoxInsetLayout.generateLayoutParams(BoxInsetLayout.java:47) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:860) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:834) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:429) at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:368) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:567) at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:549) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:863) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:549) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$1(RenderTask.java:680) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

Code

<?xml version="1.0" encoding="utf-8"?>
<android.support.wear.widget.BoxInsetLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:padding="15dp">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="5dp"
        app:boxedEdges="all">


        <TextView
            android:gravity="center"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:text="@string/app_name"
            android:textColor="@color/black" />

    </FrameLayout>

</android.support.wear.widget.BoxInsetLayout>
1
Have you checked this article for requirements: developer.android.com/training/wearables/apps/creating.html ? - y.bedrov

1 Answers

1
votes

I get the same error with android.support.wear.widget.BoxInsetLayout, but when I switch to deprecated android.support.wearable.view.BoxInsetLayout the render error disappears. I think every time you try to add a child to BoxInsetLayout it gives the same render error.

If you find a way to solve this error by using the new BoxInsetLayout please share the solution here.