0

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.

fernandospr
  • 2,779
  • 2
  • 19
  • 40
Nurbek Ss
  • 27
  • 5

1 Answers1

0

Looks like it's a cache problem, try these different solutions

Android Studio layout Error : Unknown attribute

Unknown Attribute Android: error on Android STUDIO 3.2.1

Android Studio layout Error : Unknown attribute

Barrufet
  • 352
  • 4
  • 18