I made a very basic dice roll app (in Kotlin) using Android Studio with an imageView and a button. The imageView's id is "imageView" and the button's id is "button". But in the MainActivity.kt file the id names are red in colour and when I hover over them it says "unresolved reference: imageView (or button)" Why is this happening and how do I solve this?
The id names are same on both the activity_main.xml and MainActivity.kt file: