Showing posts with label Kotlin. Show all posts
Showing posts with label Kotlin. Show all posts

8/03/2018

Error running 'app': Default Activity not found on Android with Kotlin

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.

Error running 'app': Default Activity not found on Android with Kotlin

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.