I recently upgraded flutter to 1.2 and on testing it on a real device it ends up crashing. Here's is the error it throws on the debug console:
E/AndroidRuntime(21890): FATAL EXCEPTION: main
E/AndroidRuntime(21890): Process: com.example.instagram_clone, PID: 21890
E/AndroidRuntime(21890): java.lang.RuntimeException: Unable to instantiate application io.flutter.app.FlutterApplication: java.lang.ClassNotFoundException: Didn't find class "io.flutter.app.FlutterApplication" on path: DexPathList[[zip file "/data/app/com.example.instagram_clone-Z7ozUBGogMCjxOJ-rLwCOQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.instagram_clone-Z7ozUBGogMCjxOJ-rLwCOQ==/lib/arm, /system/lib, /vendor/lib]]
E/AndroidRuntime(21890): at android.app.LoadedApk.makeApplication(LoadedApk.java:999)
E/AndroidRuntime(21890): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5742)
E/AndroidRuntime(21890): at android.app.ActivityThread.-wrap1(Unknown Source:0)
E/AndroidRuntime(21890): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1680)
E/AndroidRuntime(21890): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(21890): at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime(21890): at android.app.ActivityThread.main(ActivityThread.java:6523)
E/AndroidRuntime(21890): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(21890): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/AndroidRuntime(21890): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:857)
E/AndroidRuntime(21890): Caused by: java.lang.ClassNotFoundException: Didn't find class "io.flutter.app.FlutterApplication" on path: DexPathList[[zip file "/data/app/com.example.instagram_clone-Z7ozUBGogMCjxOJ-rLwCOQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.instagram_clone-Z7ozUBGogMCjxOJ-rLwCOQ==/lib/arm, /system/lib, /vendor/lib]]
E/AndroidRuntime(21890): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
E/AndroidRuntime(21890): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime(21890): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
E/AndroidRuntime(21890): at android.app.Instrumentation.newApplication(Instrumentation.java:1087)
E/AndroidRuntime(21890): at android.app.LoadedApk.makeApplication(LoadedApk.java:993)
E/AndroidRuntime(21890): ... 9 more
Any help will be appreciated.
I also ran flutter upgrade , flutter pub get and flutter clean.
I am testing the app on a real device and it worked before i upgraded.
MainActivity.javaorMainActivity.ktwith the proper class declaration?