Android: Compilation error with v7 support lib 27.1.0 “Program type already present” android.support.v7.recyclerview.extensions.ListAdapter

前端 未结 2 773
北荒
北荒 2020-12-19 00:23

I think there must be a bug with the 27.1.0 v7 support lib, just released. After updating my project to use it (from 26.1.0), I keep getting this compilation error:

相关标签:
2条回答
  • 2020-12-19 01:23

    Simply updating all my dependencies, cleaning and rebuilding the project did the trick for me. I think there's some kind of dependency/library conflict going on. An outdated library may be trying to use an older version of support library while you are trying to use a newer version somewhere else.

    0 讨论(0)
  • 2020-12-19 01:26

    Figured it out! Turns out the android.arch.paging:runtime-1.0.0-alpha4-1 dependency also had ListAdapter declared. After updating the paging lib to alpha6, the problem was resolved.

    EDIT For some reason, this question is getting a lot of attention! So, I thought I'd add this comment as a "teach a person to fish" sort of moment. The question: how did I figure out where my ListAdapters were coming from? The answer? If you're using Android Studio / IntelliJ IDEA, hit ctrl+n to begin searching for class names. You'll see this dialog:

    Please note the checkbox! If you don't have that checked, you will never find a class included by a library. With it checked, it'll show the provenance of every class in your project.

    0 讨论(0)
提交回复
热议问题