如果要在新项目中使用命名空间为 androidx 的库,就需要将编译 SDK 设置为 Android 9.0(API 级别 28) 或更高版本,并在 gradle.properties 文件中将以下两个 Android Gradle 插件标志设置为 true。
How are androidx and AndroidX related to Jetpack?
They are all the same thing! In a sentence, androidx is the packaging and AndroidX is the development workflow for all components in Jetpack. Jetpack is the external branding for libraries within androidx.
In more detail, Jetpack is the external branding for the set of components, tools, and guidance that improve the developer experience on Android. AndroidX is the open-source development project that defines the workflow, versioning, and release policies for ALL libraries included in Jetpack. All libraries within the androidx Java package follow a consistent set of API design guidelines, conform to SemVer and alpha/beta revision cycles, and use the Android issue tracker for bugs and feature requests.