'Flutter run takes too much time after editing MainActivity.kt

I was running some flutter project from github but the runnig taking too much time and showing some cryptic things in console like,

lib\main.dart:1
√  Built build\app\outputs\flutter-apk\app-debug.apk.
E/AndroidRuntime(18653): FATAL EXCEPTION: main
E/AndroidRuntime(18653): Process: com.example.material_color_sample, PID: 18653
E/AndroidRuntime(18653): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.material_color_sample/com.example.material_color_sample.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.material_color_sample.MainActivity" on path: DexPathList[[zip file "/data/app/~~P4fGAl2VkVQhJN2_Ab_NfQ==/com.example.material_color_sample-IxbU83HDSZU7h-NZ2F00_w==/base.apk"],nativeLibraryDirectories=[/data/app/~~P4fGAl2VkVQhJN2_Ab_NfQ==/com.example.material_color_sample-IxbU83HDSZU7h-NZ2F00_w==/lib/arm64, /data/app/~~P4fGAl2VkVQhJN2_Ab_NfQ==/com.example.material_color_sample-IxbU83HDSZU7h-NZ2F00_w==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
E/AndroidRuntime(18653):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3592)
E/AndroidRuntime(18653):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3823)
E/AndroidRuntime(18653):    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
E/AndroidRuntime(18653):    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(18653):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(18653):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2306)
E/AndroidRuntime(18653):    at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(18653):    at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(18653):    at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(18653):    at android.app.ActivityThread.main(ActivityThread.java:7886)
E/AndroidRuntime(18653):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18653):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime(18653):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime(18653): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.material_color_sample.MainActivity" on path: DexPathList[[zip file "/data/app/~~P4fGAl2VkVQhJN2_Ab_NfQ==/com.example.material_color_sample-IxbU83HDSZU7h-NZ2F00_w==/base.apk"],nativeLibraryDirectories=[/data/app/~~P4fGAl2VkVQhJN2_Ab_NfQ==/com.example.material_color_sample-IxbU83HDSZU7h-NZ2F00_w==/lib/arm64, /data/app/~~P4fGAl2VkVQhJN2_Ab_NfQ==/com.example.material_color_sample-IxbU83HDSZU7h-NZ2F00_w==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
E/AndroidRuntime(18653):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
E/AndroidRuntime(18653):    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(18653):    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(18653):    at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
E/AndroidRuntime(18653):    at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
E/AndroidRuntime(18653):    at android.app.Instrumentation.newActivity(Instrumentation.java:1315)
E/AndroidRuntime(18653):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3579)
E/AndroidRuntime(18653):    ... 12 more

kotlin file is as from that github,

Help me make it run.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source