android-studio - 迁移到 AndroidX : 后出现 Lint 错误

标签 android-studio lint androidx

在迁移/重构到 AndroidX 之后(使用 Android Studio 3.2 RC2 中的迁移工具),我得到了大量以下类型的 Lint 错误:

participant_menu.xml:9: Error: Should use android:showAsAction when not using the appcompat library [AppCompatResource]
          app:showAsAction="never" />

我很困惑;我猜这是与迁移到 AndroidX 相关的 Lint 错误。我是正确的,还是应该切换回 android 命名空间?

注意:我的 minSDK 设置为 API 16。

最佳答案

Should use android:showAsAction when not using the appcompat library [AppCompatResource] app:showAsAction="never"



如果您不使用 Appcompat图书馆,我相信你应该使用:
android:showAsAction="never"

(As documentation says)

此外,Androidx 中似乎仍有一些问题需要文档或直接指南,因为我看到有些人对此或 SearchView 有问题。或等等。

关于android-studio - 迁移到 AndroidX : 后出现 Lint 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52120714/

相关文章:

安卓工作室 : Instant run equires that the platform corresponding to your target device (Android UNOFFICIAL Preview) is installed

python - PyCharm - 始终显示检查

python - 任何警告 var shadow 参数的 python linter

android - 使用 leakcanary 2.0 alpha 2 时 list 合并失败

java - AndroidX 喷射器 : Failed to transform file 'android-all-9-robolectric-4913185-2.jar' to match attributes using transform JetifyTransform

java - 调用需要权限,在尝试获取位置时可能会被用户拒绝

android - 生成 JavaDocs Android Studio

android - MaterialDrawer 在构建时崩溃

c - 如何在 C 中不访问此变量?

android - 迁移到 AndroidX 后,错误膨胀类 android.support.design.widget.AppBarLayout