android annotation.jar,Android Studio添加了@ androidx.annotation和@ androi...

AndroidX是用于向后兼容性支持的新扩展库.将来,新功能向后兼容性支持将在AnddroidX中得到解决.正如本博客https://android-developers.googleblog.com/2018/05/hello-world-androidx.html所述

The stable release of 28.0.0 will be the final feature release packaged as >android.support. All subsequent feature releases will only be made available as >androidx-packaged artifacts.

Revision 28.0.0 Production

(September 21, 2018)

This is the stable release of Support Library 28.0.0 and is suitable for use >in production. This will be the last feature release under the >android.support packaging, and developers are encouraged to migrate to >AndroidX.

将您的应用程序从android.support移动到androidx打包的依赖项

如果您依赖于引用旧支持库的库,Android Studio将通过依赖项转换更新该库以引用androidx.依赖转换由Android Gradle Plugin 3.2.0-alpha14自动应用,它重写了JAR和AAR依赖项(和传递依赖项)的字节码和资源,以引用新的androidx打包的类和工件.我们还将提供独立的翻译工具作为JAR.

因此,在步骤1(依赖项转换)中:在gradle.properties文件中,将android.useAndroidX标志设置为true,将android.enableJetifier标志设置为true.

android.useAndroidX=true

android.enableJetifier=true

在第2步(源重构):使用Android Studio 3.2及更高版本,您可以通过选择Refactor>快速迁移现有项目以使用AndroidX.从菜单栏迁移到AndroidX.

fca876604a338645affaeeb88089a8d5.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值