Application Crash on Exit (Close Application)

I have a splash screen enabled. It displays on the app start. I have Screen1 and Screen2. On screen1 I have set exit to snackbar. It works perfect. but If I am returning from a screen2 to Screen1 and press back button it shows snackbar and then when pressed button to exit app displays the Splash Screen and a crash report.

Expected Behaviour:

It should not show any crash error.

Actual Behaviour

http://builder.makeroid.io/?locale=en#5050186745249792

Android version 8.1

Error log

java.lang.RuntimeException: Unable to start activity ComponentInfo{io.makeroid.nihar_sail.MITSOATrack/io.makeroid.nihar_sail.MITSOATrack.ATTENDANCE}: java.lang.IllegalStateException: Must Initialize Fabric before using singleton()
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2810)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2888)
	at android.app.ActivityThread.-wrap11(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1609)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:171)
	at android.app.ActivityThread.main(ActivityThread.java:6606)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:518)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
Caused by: java.lang.IllegalStateException: Must Initialize Fabric before using singleton()
	at io.fabric.sdk.android.Fabric.singleton(Fabric.java:275)
	at io.fabric.sdk.android.Fabric.getKit(Fabric.java:525)
	at com.crashlytics.android.answers.Answers.getInstance(Answers.java:34)
	at com.google.appinventor.components.runtime.util.MakeroidAnalyticsUtil.logScreenOpen(MakeroidAnalyticsUtil.java:28)
	at com.google.appinventor.components.runtime.Form.onCreate(Form.java:307)
	at android.app.Activity.performCreate(Activity.java:7087)
	at android.app.Activity.performCreate(Activity.java:7078)
	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2763)
	... 9 more
1 Like

The answer is here:

1 Like

i tried something like this and its working…

io-2018-08-31-21-34-27-277

1 Like

I know that this is working… Because I showed this above :smiley: