【问题标题】:Error: Unknown issue id "UseAppTint" [LintError]错误:未知问题 ID“UseAppTint”[LintError]
【发布时间】:2021-11-17 07:08:18
【问题描述】:

在 Android 项目上运行 lint(使用 Bitrise)会导致 Unknown issue id "UseAppTint" [LintError]

module_build_shared.gradle:

    lintOptions {
        quiet false
        abortOnError true
        ignoreWarnings true
        disable 'UseAppTint' // Using `android:tint` on an ImageView is only a problem when API < 21 (our current minSDK is higher)
    }

这是我尝试禁用的 lint 错误示例:

ProjectName/modulename/src/main/res/layout/my_layout.xml:60: Error: Must use app:tint instead of android:tint [UseAppTint]
android:tint="?attr/colorOnSurface"```

【问题讨论】:

    标签: android lint


    【解决方案1】:

    有一些issues with tint on api < 21

    您可以将 ImageView 更改为 AppCompatImageView 并在 xml 中使用 app:tint,您将摆脱该警告。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-13
      • 2016-12-11
      • 2017-05-22
      • 1970-01-01
      • 1970-01-01
      • 2020-08-11
      • 2014-09-07
      • 1970-01-01
      相关资源
      最近更新 更多