在Android Pie之后迁移到AndroidX for Wear支持库吗? [英] Migrate to AndroidX for Wear Support Libraries after Android Pie?
问题描述
从2019年秋季开始,Google Play控制台要求您的可穿戴应用程序至少针对Android 9(API级别28).
Starting in Fall of 2019 the Google Play Console requires your wearable application targets at least Android 9 (API level 28).
- 2019年8月1日:新应用程序必需
- 2019年11月1日:必须进行应用更新
将我的build.gradle
更改为目标29
后,它向我发出警告,建议我在定位Android Q或更高版本时使用AndroidX库.
After changing my build.gradle
to target 29
it gives me a warning recommending I use AndroidX libraries when targeting Android Q or newer.
我应该将com.android.support
依赖项更改为什么?
What should I change the com.android.support
dependencies to?
implementation 'com.android.support:wear:28.0.0'
implementation 'com.android.support:support-compat:28.0.0'
推荐答案
以下内容为我解决了这个问题.
Changing to the following solved the issue for me.
implementation 'androidx.wear:wear:1.0.0’
implementation 'androidx.core:core:1.1.0’
implementation 'androidx.core:core-ktx:1.1.0’ // if you are using Kotlin
此外,如果您右键单击>重构>迁移到AndroidX,Android Studio将为您处理必要的迁移.
Also, if you right click > Refactor > Migrate to AndroidX… Android Studio will take care of the necessary migrations for you.
这篇关于在Android Pie之后迁移到AndroidX for Wear支持库吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!