Name warning for constant property


AndroidStudio gives me the following warning…

Private property name DEFAULT_CIPHER_TRANSFORMATION should not contain underscores in the middle or the end

…for the following code:

class Secretify {


But according to the Kotlin naming conventions it should be correct:

Property names
Names of constants (properties marked with const, or top-level or object val properties with no custom get function that hold deeply immutable data) should use uppercase underscore-separated names:

const val MAX_COUNT = 8
val USER_NAME_FIELD = “UserName”

Do I understand the naming conventions wrong?


Might it be the missing const modifier?


const is also not used in the example from the coding conventions.


After all, you are actually defining a strong that is stored in every new instance of the class.
Have you tried using object companion object or the global scope?


Both works without warning and I will use a companion object.
After reading the coding conventions again I found my problem. I misinterpreted the term “top-level”.