Kotlin and Android Development featuring Jetpack: Cannot find identifier 'basicAI' (version B4.0 page 78)

Hello Michael,

i have problems with this line on page 78 in version B4.0:

android:entries=“@{AI.basicAI}”

it shows the error message:

Cannot find identifier ‘basicAI’

I solved the problem changing the line to:

android:entries=“@{AI.getBasicAI()}”

I found the solution on the internet page in the answer of [dominicoder]:

I used Tools > Kotlin > Show Kotlin Bytecode > Decompile to take a look how java has encoded the property.

Am i on the right path? Or do i have any other kind of problem?

I am using Android Studio 4.1.1 and these library versions:

kotlin_version = “1.4.21”
gradle_version = “4.1.1”
app_compat_version = “1.2.0”
constraint_layout_version = “2.0.4”
core_version = “1.3.2”
lc_version = “2.2.0”
nav_version = “2.3.2”

Best regards

Keno Basedow

2 Likes