I'm new to Android Studio and Kotlin and I have an interesting problem.
My Android Studio doesn't recognize some attributes. I couldn't find any answer for this.
Neither updating Android Studio nor syncing project with Gradle Files helped.
For example, in my selector, the attributes state_cheked
and state_pressed
don't work.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<item android:state_checked="true" android:drawable="@drawable/ic_home22"/>
<item android:drawable="@drawable/ic_home22" android:state_pressed="false"/>
<item android:drawable="@drawable/ic_home" />
</selector>
The error I get is Unknown attribute android:state_checked
.
Glad for any help, thanks.