简体   繁体   English

Android compileTarget P appcompat库

[英]Android compileTarget P appcompat library

https://i.imgur.com/gvEwBkL.png https://i.imgur.com/gvEwBkL.png

Android Studio tells me to use a newer Version of appcompat. Android Studio告诉我使用更高版本的appcompat。 Is there one for Android P already? Android P已经有一个了吗? I have to target P because of AndroidX. 由于AndroidX,我必须定位到P。

Is there one for Android P already? Android P已经有一个了吗?

Yes. 是。 We have 28.0.0-alpha1, released in march 我们有28.0.0-alpha1, 于3月发布

Note: 28.0.0-alpha1 is a pre-release version to support the Android P developer preview. 注意:28.0.0-alpha1是预发行版本,可支持Android P开发人员预览。 Its API surface is subject to change, and it does not necessarily include features or bug fixes from the latest stable versions of Support Library. 其API表面可能会发生变化,并且不一定包含支持库的最新稳定版本中的功能或错误修复。 For details on the P developer preview, see the release notes. 有关P开发人员预览的详细信息,请参见发行说明。

I'm not sure if you are aware of that, but AndroidX is substitution for appcompat library. 我不确定您是否知道这一点,但是AndroidX 替代了appcompat库。

AndroidX is set of libraries that package everything that is not included in the system, but in your app. AndroidX是一组库,这些库打包了系统中未包含但应用程序中没有的所有内容。 That includes support/appcompat libraries. 其中包括支持/ appcompat库。 It should be your go-to option when target Android P and future versions. 目标Android P及更高版本时,它应该是您的首选。

So if you want to target P because you want to use AndroidX, then you don't need appcompat at all , because you have everything you need in AndroidX. 因此,如果因为要使用AndroidX 想定位P,则根本不需要appcompat ,因为您拥有AndroidX所需的一切。 To check which packages from AndroidX should replace packages in appcompat, see: https://developer.android.com/topic/libraries/support-library/refactor 要检查来自AndroidX的哪些软件包应替换appcompat中的软件包,请参阅: https : //developer.android.com/topic/libraries/support-library/refactor

For more information and explanation what AndroidX really is, see this blog post on Android Developers Blog. 有关更多信息和AndroidX的真正含义,请参阅Android开发者博客上的此博客文章

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

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