简体   繁体   English

在Android Q中支持库依赖项

[英]Support library dependencies in Android Q

In order to test my app for Android Q, I've installed Android Studio 3.5 (canary) and updated my build configuration as described here: 为了测试我的Android Q应用程序,我安装了Android Studio 3.5(canary)并更新了我的构建配置,如下所述:

https://developer.android.com/preview/setup-sdk https://developer.android.com/preview/setup-sdk

But what do I do with the support library dependencies? 但是我如何处理支持库依赖项呢? The ones below are all red because: 下面的都是红色的,因为:

This support library should not use a different version (28) than the compileSdkVersion (29) 此支持库不应使用与compileSdkVersion(29)不同的版本(28)

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;
}

Do I just leave them as is until Google releases the new support library? 在谷歌发布新的支持库之前,我是否只是将它们保留下来? I'm getting a build error but I'm not sure if it's related to this or not. 我收到了构建错误,但我不确定它是否与此相关。

Support libraries will not be updated past 28. You need to migrate to androidx. 支持库将不会在28年后更新。您需要迁移到androidx。

See support library documentation where it says: 请参阅支持库文档 ,其中说:

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. 注意:随着Android 9.0(API级别28)的发布,有一个名为AndroidX的支持库的新版本,它是Jetpack的一部分。 The AndroidX library contains the existing support library and also includes the latest Jetpack components. AndroidX库包含现有的支持库,还包括最新的Jetpack组件。

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. 历史工件(那些版本为27及更早版本,打包为android.support。*)将继续在Google Maven上提供。 However, all new library development will occur in the AndroidX library. 但是,所有新的库开发都将在AndroidX库中进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM