Migrate to AndroidX for Wear Support Libraries after Android Pie?

▼魔方 西西 提交于 2019-12-11 15:20:02

问题


Starting in Fall of 2019 the Google Play Console requires your wearable application targets at least Android 9 (API level 28).

  • August 1, 2019: Required for new apps
  • November 1, 2019: Required for app updates

After changing my build.gradle to target 29 it gives me a warning recommending I use AndroidX libraries when targeting Android Q or newer.

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'

回答1:


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

Also, if you right click > Refactor > Migrate to AndroidX… Android Studio will take care of the necessary migrations for you.



来源:https://stackoverflow.com/questions/58033372/migrate-to-androidx-for-wear-support-libraries-after-android-pie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!