Problem:
I started learning Android and decided to use Kotlin instead of Java so I setup my first project and added MainActivity.kt and started running it in debug mode. I was so excited to run my first native app and see the output but this error killed my excitement.
It felt like I am in between two planets colliding when seeing this error so I took time to do some research and got a solution.
Solution:
Inside AndroidManifest.xml you have to add the code below within activity tag.
It should look like this:
I ran the code again and it worked perfectly.