Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

439
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda