【发布时间】:2023-03-10 23:20:01
【问题描述】:
我在下面有一个字符串 res 和 kotlin 数据类:
<string name="amount_format">¥%1$.2f</string>
data class TagAndTotal(
@ColumnInfo(name = "tag_name") var tagName: String,
@ColumnInfo(name = "total") var total: Float)
升级到 AGP 3.1.0 后运行 ./gradlew lint 时出现以下错误。
Error: Wrong argument type for formatting argument '#1' in
amount_format: conversion is 'f', received <ErrorType> (argument #2 in
method call) [StringFormatMatches]
applicationContext.getString(R.string.amount_format, it.total))
但在 AGP 3.0.1 中没有错误。
【问题讨论】:
标签: android android-gradle-plugin lint