Java.lang.VerifyError on start new activity

I was trying to rewrite an old project in Kotlin, and was successful in most of the porting. However, I cannot seem to find a solution to this particular problem:

04-27 20:17:16.651 6454-6454/com.vasilev.zonskoparkiranjeskopje E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.vasilev.zonskoparkiranjeskopje, PID: 6454
java.lang.VerifyError: Rejecting class com.vasilev.zonskoparkiranjeskopje.ParkingActivity because it failed compile-time verification (declaration of ‘com.vasilev.zonskoparkiranjeskopje.ParkingActivity’ appears in /data/app/com.vasilev.zonskoparkiranjeskopje-2/base.apk)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Before someone asks, I disabled Instant Run manually, but to no avail. Here is the source code of the activity in question. It is being called by a normal startActivity(intent) call. This is happening across all API levels and across two different android gradle plugins, v2.0 and v2.1.

ParkingActivity.kt.zip (3.7 KB)

I apologize for the file being in .zip. It is simply a .kt file in an archive. This forum doesn’t accept plain text I guess.

Thanks in advance, cheers.

I would like to say that I solved this and in fact it was my own fault. I had a return statement at the end of a lambda expression, which made the type of onPrepareOptionsMenu() to Nothing instead of Unit, and because it is an overridden function, the class was rejected by the runtime.