如何选择 Android 库的依赖版本?

How to choose dependency versions on Android Library?

所以我的问题很简单, 我如何选择我的 android 支持库版本?? -我应该选择最高的还是最低的来防止冲突?为什么?

PS:逻辑上我会选择最高版本,但如果使用我的库的人使用较新功能中删除的旧功能,他必须升级和重构他的代码。 同样使用最低版本也没有什么意义。

感谢您的关注。

使用 AndroidX。支持库已弃用

您可以找到最新的 AndroidX 版本 here

should i go for the highest or lowest one to prevent conflict ? and WHY ?

由于他们引入新级别的唯一原因是改进(漏洞、性能、安全性等),因此您应该选择最新的或接近最新的。

PS: logically i'll go for the highest version, but if someone who uses my library use an older functionality that is removed in the newer one, he must upgrade and refactor his code. also using the lowest version doesn't really make sense.

如果所有图书馆开发人员都想着每个图书馆用户而不是普通观众,那么所有图书馆都应该实施石器时代支持图书馆。另外 google 不会弃用通常有用的 API,因此您不必担心。