Moshi: Can't import PolymorphicJsonAdapterFactory i Kotlin

Created on 1 Nov 2019  Â·  5Comments  Â·  Source: square/moshi

There is properly a simple answer to this but I just can't access PolymorphicJsonAdapterFactory from my kotlin app - it can't build because it can't find PolymorphicJsonAdapterFactory.

What should be included to get this? I have tried all the below together even though the first one should not be needed, but still this package is not possible to import.

    implementation 'com.squareup.moshi:moshi:1.9.1'
    implementation 'com.squareup.moshi:moshi-kotlin:1.9.1'
    kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.1"

And I have this one as well: (should not be related)

    implementation 'com.squareup.retrofit2:converter-moshi:2.6.2'

Most helpful comment

You forgot one. ;)

implementation 'com.squareup.moshi:moshi-adapters:1.9.1'

All 5 comments

You forgot one. ;)

implementation 'com.squareup.moshi:moshi-adapters:1.9.1'

Yep @RBusarow has it right

Thanks - but I think that should be added to the readme - the others are mention there but not this one. (or Polymorphic handling for that sake)

Wanna send a PR to add it to the readme?

On Sun, Nov 10, 2019 at 2:36 PM Morten Holmgaard notifications@github.com
wrote:

Thanks - but I think that should be added to the readme - the others are
mention there but not this one. (or Polymorphic handling for that sake)

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/square/moshi/issues/997?email_source=notifications&email_token=AAKMJPTUJW2HSKB46LU57UDQTBPEZA5CNFSM4JIABOKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDVE3II#issuecomment-552226209,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAKMJPQTI4WEOFFMMR7QY6LQTBPEZANCNFSM4JIABOKA
.

Sorry no - I do not have time at the moment and I yet don't know how the Polymorphic stuff works.

Was this page helpful?
0 / 5 - 0 ratings