Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app crashes if moved to foreground after running on background for some time (several hours or a night) #8564

Closed
annadanchenko opened this issue Jul 12, 2019 · 4 comments
Labels

Comments

@annadanchenko
Copy link

annadanchenko commented Jul 12, 2019

Description

Type: Bug

Summary: App crashed after it's moved from background to foreground. Usually, it happens if app was on background for several hours or left for a night. Full logcat is attached at the end of report.
Screenshot_20190712-114623

--------- beginning of crash
07-11 19:16:15.817 18754 18754 E AndroidRuntime: FATAL EXCEPTION: main
07-11 19:16:15.817 18754 18754 E AndroidRuntime: Process: im.status.ethereum, PID: 18754
07-11 19:16:15.817 18754 18754 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{im.status.ethereum/im.status.ethereum.MainActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.swmansion.rnscreens.Screen$ScreenFragment: calling Fragment constructor caused an exception
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2951)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6718)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.swmansion.rnscreens.Screen$ScreenFragment: calling Fragment constructor caused an exception
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v4.app.Fragment.instantiate(Fragment.java:465)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v4.app.FragmentContainer.instantiate(FragmentContainer.java:50)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v4.app.FragmentState.instantiate(FragmentState.java:80)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v4.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:3109)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v4.app.FragmentController.restoreAllState(FragmentController.java:158)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:344)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:85)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:51)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at im.status.ethereum.MainActivity.onCreate(MainActivity.java:120)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:7144)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:7135)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	... 11 more
07-11 19:16:15.817 18754 18754 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at android.support.v4.app.Fragment.instantiate(Fragment.java:443)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	... 23 more
07-11 19:16:15.817 18754 18754 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Screen fragments should never be restored
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	at com.swmansion.rnscreens.Screen$ScreenFragment.<init>(Screen.java:23)
07-11 19:16:15.817 18754 18754 E AndroidRuntime: 	... 26 more

Expected behavior

user can proceed working with app after it's moved to foreground

Actual behavior

app crashed

Reproduction

  • Open Status
  • open public chat where no new messages will be recieved
  • move app to background
  • leave phone for a night
  • turn on phone and move app to foreground

Additional Information

  • Status version: nightly from July 11
  • Operating System: Android 9, real Pixel XL

Logs

crashed.log

@Serhy
Copy link
Contributor

Serhy commented Jul 30, 2019

Confirmed the crash with Android 8.1 and Android 9 with Release candidate 0.14 (16th Jenkins build)
On both devices, Status left running on background overnight.

I've seen it when Status was on background for ~1h, sometimes (so no need to wait so long to reproduce the issue)

@annadanchenko
Copy link
Author

still can repro on nightly August 29 build (Android 9, Pixel XL), so adding to v1 release scope

@vitvly
Copy link
Contributor

vitvly commented Oct 1, 2019

@Serhy does it still reproduce? Error description in the image above suggests that it could be resolved in #8868

@Serhy
Copy link
Contributor

Serhy commented Oct 1, 2019

@siphiuel No, can't reproduce.
Now, with the latest nightly, there is no such crash. App simply re-opens if it was closed (lost connection or something like that if I recall correctly about the reason of when that crash happened in the past).
No crash errors now.
Closing the issue.

@Serhy Serhy closed this as completed Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants