question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find the setter for attribute 'algolia:attribute' with parameter type java.lang.String on android.widget.TextView

See original GitHub issue

Hello!

After updating to Android Studio 3.0 and to Android Gradle Plugin 3.0, I’ve encountered the following compile time error: Error:(48, 38) Cannot find the setter for attribute 'algolia:attribute' with parameter type java.lang.String on android.widget.TextView.

Here is my layout where I’m using this attribute:

            <TextView
                android:id="@+id/book_name"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                android:fontFamily="sans-serif-condensed"
                android:padding="6dp"
                android:textAlignment="center"
                android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                android:textSize="20sp"
                android:typeface="normal"
                android:scrollHorizontally="false"
                android:maxLines="5"
                algolia:attribute='@{"name"}'
                android:layout_marginStart="8dp"
                app:layout_constraintLeft_toRightOf="@+id/cover"
                android:layout_marginLeft="8dp"
                android:layout_marginEnd="16dp"
                app:layout_constraintRight_toRightOf="parent"
                android:layout_marginRight="16dp"
                android:layout_marginTop="16dp"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"
                android:layout_marginBottom="16dp"
                app:layout_constraintHorizontal_bias="1.0"
                app:layout_constraintVertical_bias="0.0" />

Error is raised on 0.8.0 version of instantsearch, as well as on 1.1.2.

Looks like it’s a problem in BindingHelper class where you set @BindingAdapter("attribute"). As in docs, now you need to set "bind:attribute" instead of just "attribute", i.e. you need to set XML namespace here, and "bind" namespace is for custom namespaces.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
fobo66commented, Nov 10, 2017

@robertmogos I’ve tried new version already, problem is fixed, project is built successfully.

1reaction
sasha00123commented, Nov 10, 2017

Thank you😀 I’m glad to hear it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find the setter for attribute 'algolia:attribute ... - GitHub
Cannot find the setter for attribute 'algolia:attribute' with parameter type java.lang.String on android.widget.ImageView. #72.
Read more >
Cannot find the setter for attribute with parameter
but i have another method @BindingAdapter({"bind:image_round"}) public static void loadRoundImage(ImageView imageView, String url) and it is ...
Read more >
Execution failed: cannot find setter for attribute **EDITED
data binding error ****msg:Cannot find the setter for attribute 'algolia:attribute' with parameter type java.lang.String on android.widget.
Read more >
Android Data Binding: Custom Setters | by George Mount
The BindingAdapter annotation takes the attribute name as its parameter. Anything in the application namespace doesn't need any namespace in the parameter, but ......
Read more >
TextView - Android Developers
java.lang.Object ... To customize the appearance of TextView, see Styles and Themes. XML attributes ... Autofill type for views that cannot be autofilled....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found