为了针对 Android Q 测试我的应用,我安装了 Android Studio 3.5 (canary) 并更新了我的构建配置,如下所述:
https://developer.android.com/preview/setup-sdk
但是我该如何处理支持库依赖项呢?下面的都是红色的,因为:
This support library should not use a different version (28) than the compileSdkVersion (29)
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
testImplementation 'junit:junit:4.12') {
transitive = true;
}
在 Google 发布新的支持库之前,我是否可以让它们保持原样?我遇到构建错误,但我不确定它是否与此有关。
最佳答案
支持库将不会在 28 之后更新。您需要迁移到 androidx。
参见 support library documentation它说:
Note: With the release of Android 9.0 (API level 28) there is a new version of the support library called AndroidX which is part of Jetpack. The AndroidX library contains the existing support library and also includes the latest Jetpack components.
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.
关于android - 支持 Android Q 中的库依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55236947/