I used to have onDetach in my Fragment and in it I was just using for releasing resources (Context = null and stuff like that). Since then I got a couple of this Illegal state exceptions. I deleted onDetach and moved the code to other end of life method. I still get this exception, I thought it was from users who didn't update the app, but in android vitals it said it is from the latest version of app. Why is this happening and how to deal with it? Or is it just error from google play console telling the wrong version?
java.lang.IllegalStateException:
at android.support.v4.app.FragmentManagerImpl.detachFragment (FragmentManagerImpl.java)
or .saveAllState (FragmentManagerImpl.java)
at android.support.v4.app.FragmentController.saveAllState (FragmentController.java)
at android.support.v4.app.FragmentActivity.onSaveInstanceState (FragmentActivity.java)
at android.support.v7.app.AppCompatActivity.onSaveInstanceState (AppCompatActivity.java)
at android.app.Activity.performSaveInstanceState (Activity.java:1337)
at android.app.Instrumentation.callActivityOnSaveInstanceState (Instrumentation.java:1300)
at android.app.ActivityThread.callCallActivityOnSaveInstanceState (ActivityThread.java:4131)
at android.app.ActivityThread.performStopActivityInner (ActivityThread.java:3528)
at android.app.ActivityThread.handleStopActivity (ActivityThread.java:3588)
at android.app.ActivityThread.access$1200 (ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1404)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:150)
at android.app.ActivityThread.main (ActivityThread.java:5621)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:684)