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

前端 未结 2 774
北荒
北荒 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: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.

提交回复
热议问题