In which task and step of the codelab can this issue be found?
6 - Adding android:onClick="@{()...." to radio buttons on the fragment_flavor.xml layout.
Describe the problem
If you select any flavor (I selected "salted caramel", the app terminates with this exception:
java.lang.IllegalStateException: Could not find method @{() -> viewModel.setFlavor(@string/salted_caramel)(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.radiobutton.MaterialRadioButton with id 'salted_caramel'
Steps to reproduce?
Add the listener bindings to the fragment_flavor.xml layout
Build and run the app
Select a quantity on 1st fragment screen
Select ANY flavor on the 2nd fragment screen
You'll get the above error
Versions
Studio Build: AI-211.7628.21.2111.8193401
Version of Gradle Plugin: 7.1.2
Version of Gradle: 7.2
Version of Java: Could not find a JAVA version anywhere, but found this: default JDK: 11.0.11
OS: Windows 10
Kotlin Plugin: JetBrains 211-1.6.10-Release-923-AS7442.40
Additional informationInclude screenshots if they would be useful in clarifying the problem.
URL of codelab https://github.com/google-developer-training/android-basics-kotlin-cupcake-app
In which task and step of the codelab can this issue be found?
6 - Adding android:onClick="@{()...." to radio buttons on the fragment_flavor.xml layout.
Describe the problem If you select any flavor (I selected "salted caramel", the app terminates with this exception: java.lang.IllegalStateException: Could not find method @{() -> viewModel.setFlavor(@string/salted_caramel)(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.radiobutton.MaterialRadioButton with id 'salted_caramel'
Steps to reproduce?
Versions Studio Build: AI-211.7628.21.2111.8193401 Version of Gradle Plugin: 7.1.2 Version of Gradle: 7.2 Version of Java: Could not find a JAVA version anywhere, but found this: default JDK: 11.0.11 OS: Windows 10 Kotlin Plugin: JetBrains 211-1.6.10-Release-923-AS7442.40
Additional information Include screenshots if they would be useful in clarifying the problem.