Crash when closing the app while the rn activity is not on top
See original GitHub issueWhen an app opens a new activity and then is backgrounded it crashes because getCurrentActivity returns another activity.
In my case it happens when using facebook sign in and then backgrounding the app.
EDIT: Can’t seem to repro consistently but I think my theory about getCurrentActivity is still valid.
IllegalStateException
In order to use RNScreen components your app's activity need to extend ReactFragmentActivity or ReactCompatActivity
com.swmansion.rnscreens.ScreenContainer in <init> at line 44
com.swmansion.rnscreens.ScreenContainerViewManager in createViewInstance at line 21
com.swmansion.rnscreens.ScreenContainerViewManager in createViewInstance at line 9
com.facebook.react.uimanager.ViewManager in createView at line 44
com.facebook.react.uimanager.NativeViewHierarchyManager in createView at line 260
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation in execute at line 200
com.facebook.react.uimanager.UIViewOperationQueue$1 in run at line 908
com.facebook.react.uimanager.UIViewOperationQueue in flushPendingBatches at line 1021
com.facebook.react.uimanager.UIViewOperationQueue in access$2500 at line 46
com.facebook.react.uimanager.UIViewOperationQueue$2 in runGuarded at line 979
com.facebook.react.bridge.GuardedRunnable in run at line 24
android.os.Handler in handleCallback at line 739
android.os.Handler in dispatchMessage at line 95
android.os.Looper in loop at line 145
android.app.ActivityThread in main at line 5942
java.lang.reflect.Method in invoke
java.lang.reflect.Method in invoke at line 372
com.android.internal.os.ZygoteInit$MethodAndArgsCaller in run at line 1399
com.android.internal.os.ZygoteInit in main at line 1194
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Why do my apps keep crashing on Android, How to fix it
To do this, go to Settings -> Apps and select the app that keeps crashing. Tap on the app's name and then tap...
Read more >React Native app crashes without any error log - Stack Overflow
Open Android Studio · Open Logcat · Click on "Edit Filter Configuration" in the right top of the logcat screen · Fill in...
Read more >[Android] - Release Application crashes immediately after ...
Description Application crashes immediately after having upgraded to 0.70.0 with newArchEnabled=true. If i keep newArchEnabled=false the app ...
Read more >How to Fix Crashing Apps on an iPhone or Android?
10 Solutions to fix App Crashes and Keep Apps Running: For Apple iPhone, ... Then you'll have to slide the app you want...
Read more >App crashing immediately on start up after upgrading to iOS12.
Running fine in simulator but crashes in device. No crash logs recorded. ... Tried "Eare All Content and Settings" but it does not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kmagiera
We’re using Intercom Android SK through react-native-intercom. We use it as our in-app support chat. Is it possible Intercom’s messenger is the activity which is covering the current one as you described?
Anyways, we’ll give a shot to alpha.20, thank you very much!
Ok, so I am closing it. Looks like it was https://github.com/software-mansion/react-native-screens/commit/c0b73545ffba5eb3310451c368ec6cbcac429a59 which @kmagiera linked since no more activity on the issue since then.