Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

435
Vistas
How to use kotlin.Pair with databinding?

It is working fine as long as I am using the data model with two fields.

But when I am trying to use kotlin. Pair it is failing to build and giving nit informative error :

....\DataBinderMapperImpl.java:20: error: cannot find symbol
import .....databinding.ItemCurrencyBindingImpl;


  symbol:   class ItemCurrencyBindingImpl

  location: package ......databinding

Xml code :

    <variable
        name="currency"
        type="kotlin.Pair"/>
</data>

<TextView
    android:layout_width="@dimen/currency_dropdown_width"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical"
    android:gravity="center|start"
    android:padding="@dimen/currency_dropdown_padding"
    android:text="@{currency.first}"
    app:drawableEnd="@{currency.second}"
    app:drawableSize="@{@dimen/currency_dropdown_image_size}"
    tools:text="@string/pound"/></layout>
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You need to add the import of the type pair to your data section, and also declare the type of the elements of the pair.

If you currency type is Pair<String, Int> you can declare it like this:

<import type="kotlin.Pair"/>
<variable name="currency" type="Pair&lt;String, Int&gt;"/>
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda