Your First Kotlin Android App - Part 27: Adding a | Ray Wenderlich

For your game to work, it requires a countdown timer. Learn what it is and how to use it.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4738-your-first-kotlin-android-app/lessons/27

I am getting Runtime Exception. Please see the stacktrace below. Can you please check

2019-01-14 10:16:16.209 5389-5389/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: timefighter.sanchand.com.timefighter, PID: 5389
java.lang.RuntimeException: Unable to start activity ComponentInfo{timefighter.sanchand.com.timefighter/timefighter.sanchand.com.timefighter.MainActivity}: kotlin.UninitializedPropertyAccessException: lateinit property tapButton has not been initialized
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property tapButton has not been initialized
at timefighter.sanchand.com.timefighter.MainActivity.onCreate(MainActivity.kt:18)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)

@macsimus Can you please help with this when you get a chance? Thank you - much appreciated! :]

@csanthosh13 Do you still have issues with this?

this part is the tricky one