BaseRecyclerViewAdapterHelper icon indicating copy to clipboard operation
BaseRecyclerViewAdapterHelper copied to clipboard

4.0版本的兼容性问题建议

Open minwang1 opened this issue 1 year ago • 3 comments

Describe the bug 因为库使用了Databinding,而databindng的版本由Gradle plugin版本决定的,4.0.0-beta02使用了7.2.2,基本上老的项目就不能用了,并且还会和旧版本很库有依赖冲突

比如我的项目一开始无法编过,gradle报错也不正确。升级gradle版本才发现这个问题,报如下依赖错误

  1.  Dependency 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0' requires libraries and applications that
      depend on it to compile against version 31 or later of the
      Android APIs.

      :app is currently compiled against android-29.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 31, for example 33.

感觉这个最好可以在wiki里指出来,引导大家使用合适的版本,避免浪费大家时间XD。

minwang1 avatar Sep 13 '22 08:09 minwang1

好的,谢谢建议,后面会把Databinding从库中拆分出来,作为附加库依赖

limuyang2 avatar Sep 21 '22 09:09 limuyang2

你项目的 Gradle 版本是多少呢?

limuyang2 avatar Sep 21 '22 09:09 limuyang2

Android Gradle plugin 7.2.2 gradle 7.3.3

minwang1 avatar Sep 21 '22 09:09 minwang1

你好,麻烦尝试下 4.0.0-beta04

limuyang2 avatar Sep 23 '22 02:09 limuyang2

hello Android Gradle plugin 7.2.2 gradle 7.3.3 compilesdkversion 29 试了报下面错误,说明还是至少要compilesdkversion 升到33

3 issues were found when checking AAR metadata:

  1.  Dependency 'androidx.recyclerview:recyclerview:1.3.0-beta02' requires libraries and applications that
      depend on it to compile against version 33 or later of the
      Android APIs.

      :app is currently compiled against android-29.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 33, for example 33.

      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

  2.  Dependency 'androidx.customview:customview-poolingcontainer:1.0.0-beta02' requires libraries and applications that
      depend on it to compile against version 31 or later of the
      Android APIs.

      :app is currently compiled against android-29.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 31, for example 33.

      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

  3.  Dependency 'androidx.core:core:1.7.0' requires libraries and applications that
      depend on it to compile against version 31 or later of the
      Android APIs.

      :app is currently compiled against android-29.

      Recommended action: Update this project to use a newer compileSdkVersion
      of at least 31, for example 33.

      Note that updating a library or application's compileSdkVersion (which
      allows newer APIs to be used) can be done separately from updating
      targetSdkVersion (which opts the app in to new runtime behavior) and
      minSdkVersion (which determines which devices the app can be installed
      on).

试了将compilesdkversion 升级到33是可编译过的,正常运行的。 应该需要降低recyclerview的版本,主要还是要看要兼容到sdk的版本,可能29或30的覆盖会比较好

minwang1 avatar Sep 23 '22 07:09 minwang1

你好,为了ConcatAdapter使用GridLayoutManager,必须使用 recyclerview 1.3.0 版本。现在谷歌在新版本库中限制最低版本,以强制要求开发者进行API版本升级。

limuyang2 avatar Sep 23 '22 10:09 limuyang2

@limuyang2 好的感谢,就像之前comment里写的,能把api要求wiki中指出就好了,问题先关了吧。

minwang1 avatar Sep 25 '22 07:09 minwang1