Hi, why `const` is not allowed for field that refe...
# android
t
Hi, why
const
is not allowed for field that references generated const classes like android
R
subclasses? IMHO, technically it should be allowed. For example,
const val TEXT_RES = R.string.some_text
g
It is allowed. Maybe you do something wrong? Show your code
t
hmm, just this on the top level
private const val DEFAULT_TITLE_TEXT_RES = R.string.big_teaser_title_text
and it says that R.string.XXX is not a constant value kotlin version is
1.1.51
, project itself is an android lib project
g
Can’t reproduce. Try to “Invalidate cache / Restart”
g
Maybe because R.string.big_teaser_title_text defined in an other module
g
works on 1.1.4 & 1.1.51
g
resource ids from other modules are not constants
t
no, R.string is defined in the same module will try to invalidate cache
doesn't help (
ok, the behavior is valid. It is an android lib project and R classes will be regenerated on main app build
👍 2