Failed Linking File Resources (FLFR)


FLFR:   SOLD       




Hi guys, I've encountered this kind of error:

"Failed linking file resources"

With details as follows:

"error: attribute type (aka com.testapp.client:type) not found"

The problem arose when I was playing around with MotionLayout, especially when adding KeyPosition Element to the file scenario.

As an illustration, my code at that time was more or less like this:

<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">

<Transition
    app:constraintSetEnd="@id/collapsed"
    app:constraintSetStart="@id/expanded">

    <OnSwipe
        app:dragDirection="dragUp"
        app:touchAnchorId="@id/recyclerview"
        app:touchAnchorSide="top" />

    <KeyFrameSet>
        <KeyAttribute
            app:framePosition="60"
            app:target="@id/toolbar_image">
            <CustomAttribute
                app:attributeName="imageAlpha"
                app:customIntegerValue="255" />
        </KeyAttribute>
        <KeyAttribute
            app:framePosition="90"
            app:target="@id/toolbar_image">
            <CustomAttribute
                app:attributeName="imageAlpha"
                app:customIntegerValue="0" />
        </KeyAttribute>
        <KeyPosition
            app:type="pathRelative"
            app:framePosition="50"
            app:target="@id/title"
            app:percentX="0.9" />
    </KeyFrameSet>
</Transition>

<ConstraintSet android:id="@+id/expanded">
    <Constraint
        android:id="@id/toolbar_image"
        android:layout_height="200dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
    <Constraint
        android:id="@id/title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginBottom="24dp"
        android:scaleX="1.0"
        android:scaleY="1.0"
        app:layout_constraintBottom_toBottomOf="@id/toolbar_image"
        app:layout_constraintStart_toStartOf="parent" />
</ConstraintSet>

<ConstraintSet android:id="@+id/collapsed">
    <Constraint
        android:id="@id/toolbar_image"
        android:layout_height="?attr/actionBarSize"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
    <Constraint
        android:id="@id/title"
        android:layout_marginStart="20dp"
        android:layout_marginBottom="0dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleX="0.625"
        android:scaleY="0.625"
        app:layout_constraintBottom_toBottomOf="@id/toolbar_image"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@id/toolbar_image" />

</ConstraintSet>

Please note that I have used the latest version of Android Studio and Androidx support libs.

Solution

The “type” attribute on the KeyPosition element has changed since the Alpha 2 version to keyPositionType, so you just need to adjust it to the rules that apply in the latest version, the results will be more or less like this.

Previous (old version)

        <KeyPosition
            app:keyPositionType="pathRelative"
            app:framePosition="50"
            app:target="@id/title"
            app:percentX="0.9" />

Instead (latest version)

        <KeyPosition
            app:type="pathRelative"
            app:framePosition="50"
            app:target="@id/title"
            app:percentX="0.9" />

done!


Post a Comment

Previous Next

نموذج الاتصال