如果我发布的库使用 AndroidX 但使用它的应用程序不是,有什么问题吗?

Any issue if a library I shipped uses AndroidX but the app using it is not?

我开发了一个 Android 库,它仍在使用旧的支持库。最近我的一位用户在将其与他们的应用程序集成时面临多个问题,因为他们使用的是 AndroidX 库。

我想知道我是否应该迁移到 AndroidX?如果是这样,未迁移到 AndroidX 的应用程序是否会出现任何兼容性问题?

I am wondering whether I should migrate to AndroidX?

是的,你应该。
所有新库,如 Material Components for Android, Firebase and Google Play services 都需要 androidx 迁移。
你迟早要迁移。

另外support libraries将不会更新,这意味着没有修复,没有新功能。在官方文档中你可以找到:

You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.*) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.

We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.

这里是 migrate 的所有信息。

If so, will there be any compatibility issue with the app that havn't migrated to AndroidX

是的,与您面临的问题相同,但在其他主要图书馆的任何情况下都会发生。

看到这个

When you upload an APK, it needs to meet Google Play’s target API level requirements. Starting August 1, 2019, Google Play requires that new apps target at least Android 9.0 (API level 28), and that app updates target Android 9.0 from November 1, 2019. Until these dates, new apps and app updates must target at least Android 8.0 (API level 26).

即使您的应用程序版本较低 targetVersion 如果您计划进行更新。然后 Google 会促使您增加 targetVersion,这会导致您从支持库迁移到 AndroidX。还有现有的库,它们的作者也将更新为 AndroidX。所以没有别的办法,你需要推送到androidx个组件。

迁移安全,过程简单。如果您迁移,不会有太多代码更改。