I've been getting this warning recently:

Resource IDs will be non-final by default in Android Gradle Plugin version 8.0, avoid using them in const fields
This applies mostly to custom views, where I have declared drawables or colors that might be needed.
What would be the alternative for declaring these fields?
When I upgraded to Android Gradle 8.0, it added this line automatically to my gradle.properties file:
android.nonFinalResIds=false
Which disables the feature and doesn't require any "migration" logic (the const vals don't have to be changed).
If you want to enable this flag, you'd have to remove the const modifier from all the variables that have a resource assigned to them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With