Last week we upgraded to the latest version of React. Around the same time my boss updated his phone to iOS 13.1.2 (got a new phone)
I have a iPhone 5S on my desk with iOS 12.x (whatever the latest in that branch is I updated it today)
I also run the app on my Android 10 phone.
After almost no time at all with the app not focused my boss's phone relaunches the app as if the phone just rebooted. Splash screen and everything. This doesn't happen on the very old iPhone 5. Not on Android either. Of course this relaunch can happen under certain circumstances that are reasonable. For instance my boss will open our app, open up IG and TW, then go back to our app and it relaunches.
We narrowed it down to our upgrade of .60.x to 0.61.1 last Thursday.
This is a very jarring UX issue. I'm not sure how to produce a reproducible use case since it depends on the latest version of iOS and I'm really busy trying to fix other bugs atm related to the new version of iOS. Has anyone else experienced this?
Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?
👉 Click here if you want to take another look at the Bug Report issue template.
Are you sure your app is not crashing in the background? Do you have any crash reporting service enabled?
@radko93 Pretty sure it's not crashing. I've narrowed it down to a commit that was responsible for the 0.61 upgrade -- before that commit doesn't matter how long you put the app in the background (say 10 minutes) it's still active when you come back.
We've noticed as little as 1 minute timed of launching the app going over to Instagram and doing literally nothing for a minute then back to our app, relaunch.
We have no background processes for this app. And while we don't have a ton of devices to test on at the moment we have only noticed it on the latest iOS.
@bobber205 @radko93 Have almost same issue
I have described it in https://github.com/facebook/react-native/issues/26746
Just app is really crashing on iOS 13.1.2 when device is sleeping or app just staying in background
Stracktrace crash report is available in my issue
@oleksandr-dziuban

Are you using Websockets @bobber205 @oleksandr-dziuban ?
Are you using Websockets @bobber205 @oleksandr-dziuban ?
No, I don't use Websockets.
For data transport I use GraphQL based on Apollo Client without Websockets.
For Native features I use these libraries only:
"@react-native-community/async-storage": "1.6.2",
"@react-native-community/netinfo": "4.2.2",
"react-native": "0.61.2",
"react-native-dynamic-fonts": "0.3.1",
"react-native-image-crop-picker": "0.25.2",
"react-native-keyboard-aware-scroll-view": "0.9.1",
"react-native-popup-menu": "0.15.6",
"react-native-render-html": "4.1.2",
"react-native-restart": "0.0.13",
"react-native-router-flux": "4.0.6",
"react-native-share": "2.0.0",
"react-native-sqlite-storage": "4.1.0",
"react-native-svg": "9.9.5",
"react-native-version-number": "0.3.6",
"react-native-view-shot": "3.0.2",
"react-native-webview": "7.2.7",
"react-native-woodpicker": "0.0.17",
"rn-fetch-blob": "0.11.2",
There are no background processes in the app.
@radko93 Just interesting, I have found how to reproduce that even on iOS 13.0 Simulator with Xcode 11.0
1) Just open an application
2) Work with it some time
3) After this click on hardware "ON/OFF" button on Simulator
4) Wait 1-2 minutes to emulate sleep mode
5) Unlock device again
6) Application will be crashed
Veeery tricky issue....
@radko93 Yes, very easy to reproduce even on newest iOS 13.1 Simulator (Xcode 11.1)
Also reproduced on iOS 13.1 Simulator iPhone 11 (Xcode 11.1):
For best crash detection I use react-native-debugger with Memory Tab: when application will be crashed - we will see that in Select Javascript Area VM instance field
@oleksandr-dziuban it's complicated because I cannot reproduce it for now with my app on RN 0.61.2.
Did you wait 1-2 minutes in sleep mode on simulator?
Maybe this is native libraries specific issue? Some library is crashing in sleep mode, maybe react-native-webview, maybe netinfo.... Tricky case....
@oleksandr-dziuban I wait 10 or more minutes on iPhone 6s with latest iOS (Release build). Might be netinfo, try to comment it out. Try to comment out different things and see if it helps.
@radko93
I'm using Apollo Client for GraphQL data transport, it can use Websockets under the hood for GraphQL subscriptions
Maybe this causing crash
Additionally I will comment all Native packages one by one to check
Disabled NetInfo, WebView - nothing changed
@radko93 I have reproduced this even on fresh react-native app without any additional code!
Steps:
1) Use iOS 13.0 or 13.1 Simulator, Xcode 11.0 or 11.1, [email protected]
2) Generate fresh app: react-native init TestApp
3) Run iOS app in Simulator: react-native run-ios --simulator="iPhone 11"
4) Wait until application will be assembled and home screen activated
5) Click on Hardware Power Button on the right side in Simulator, device will activate sleep mode
6) Wait ~ 1 min and Unlock Simulator screen
7) Application will be crashed
This is the same issue that I am seeing, but I am on react-native: 0.59.8
Are you using Websockets @bobber205 @oleksandr-dziuban ?
i don't use Websockets either.
@SYoder1 Good to know! I think that means this is a React Native + newest version of iOS issue not specific to a version of react (seems that way anyway)
@bobber205 I am also not using Websockets
@bobber205 Yes, I think in iOS 13 we have new mechanism for sleep/awake in apps and something went wrong now with react-native apps.
@oleksandr-dziuban I tried but my app did not crash.
But i added some capabilities on Xcode
Background Modes is enabled
Audio, Airplay ...
Background Fetch
Remote notifications
and these are selected
I will try to do the same
@farad4y @bobber205 I have added this capabilities.
I see a bit different behaviour now:
Application is not crashing, it is in Active App List, but when I select it again it starting from scratch.
Looks like app was totally refreshed, something like when RAM is not enough to keep app active.
@oleksandr-dziuban That's exactly what we're seeing.
@bobber205 @farad4y
Background Modes requires additional setup for BGTaskSchedulerPermittedIdentifiers in Info.plist.
Otherwise we can't deploy app to store
I don't think Background Modes solves the issue
@bobber205 @farad4y
Background Modes requires additional setup for BGTaskSchedulerPermittedIdentifiers in Info.plist.
Otherwise we can't deploy app to store
No, you don't need to add these into info.plist
@farad4y You need to setup BGTaskSchedulerPermittedIdentifiers in Info.plist to whitelist this background processes. Please read this: https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler
I found that, because TestFlight iTransporter throws and error with this info when I deploy production build to TestFlight
[16:31:35]: [iTMSTransporter] 1 package(s) were not uploaded because they had problems:
[16:31:35]: [iTMSTransporter] /var/folders/1b/gl7yt7ds26vcyr1pkgld6l040000gn/T/d20191008-871-5aoqp7/1446718467.itmsp - Error Messages:
[16:31:35]: [iTMSTransporter] ERROR ITMS-90771: "Missing Info.plist value. The Info.plist key 'BGTaskSchedulerPermittedIdentifiers' must contain a list of identifiers used to submit and handle tasks when 'UIBackgroundModes' has a value of 'PROCESSING'. For more information, refer to the Information Property List Key Reference at https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html."
[16:31:35]: [iTMSTransporter] [2019-10-08 16:31:34 PDT] <main> DBG-X: Returning 1
[16:31:35]: iTunes Transporter output above ^
I really don't need Background Modes because I don't have tasks for that, I can't add anything to info.plist
Application should work correctly on iOS 13.1 in sleep mode without any crash.
I think this is React Native issue for iOS 13 phones only, because on iPad OS 13 on iPads I don';t have crashes. iPad OS 13 now is separate OS for tablets. It doesn't have issues with sleep mode for react-native apps
Guys, is it possible to research this issue? I have added crash Report from production users in my separate issue ticket: https://github.com/facebook/react-native/issues/26746
It happens on iOS 13 on iPhones only (I saw crash reports for iPhones 6S, 8, 11)
Thanks a lot for you help
having exactly same issue as you @oleksandr-dziuban. have you found something new?
having exactly same issue as you @oleksandr-dziuban. have you found something new?
Hi, @hackdie
No, didn't found yet how to fix this issue. React Native team don't have ideas yet too...
Only one possible fix maybe can help:
having exactly same issue as you @oleksandr-dziuban. have you found something new?
Hi, @hackdie
No, didn't found yet how to fix this issue. React Native team don't have ideas yet too...
Only one possible fix maybe can help:
- I'm building iOS/Android app on CircleCI with automated Fastlane Tool.
- I'm still building app with Xcode 10.2.1 CircleCI image
- I can't switch to latest Xcode 11.1.0 CircleCI image, because Fastlane throws an error with it.
- I created an issue with this error on Fastlane GitHub community.
- Maybe if we build an app with Xcode 11.1 tools we will not have an issue with Crash in sleep mode on iOS 13, I don't know....
- Anyway waiting feedback regarding Fastlane Error 65 on Xcode 11.1 image on CircleCI
@oleksandr-dziuban
im using Github actions with Fastlane Tool, ill try to set xcode 11 to build the app and let you know if i find something 🤔
@hackdie Thanks a lot! Waiting your feedback.
If crash will not be reproduced, we need to build apps for iOS 13.1 only on Xcode 11.1 then.
We're also experiencing an almost same issue described here in our production app deployed a couple weeks ago and have gotten some user feedbacks about frequent relaunching too.
We use Sentry to track app crashes, and it seems we are receiving no crash reports around these relaunches.
Recently upgraded to RN 0.61.2, and using WebSocket. I experience this issue on my iPhone XS Max, iOS 13.1.1 From a user feedback it is happening on iPhone 8 with iOS13.1.1 too.
I have same issue when use websocket in my app
Having the same issue literally
Hoping the RN team has seen this -- pretty bad issue on the newest iOS.
Ping.
Downgraded to 0.60.6, works fine, so the best way to hotfix is to downgrade, it is pretty simple, took about 10 minutes.
Not possible for me because in 0.61.1 fixed issue with status bar ios 13.
Same issue here-- app gets terminated in the background for no apparent reason. This started immediately after updating from 60.3 to 61.2
We ARE using websockets through this: https://github.com/sendbird/SendBird-SDK-JavaScript but that never gave us trouble in the past.
Glad I found this issue after tearing my hair out trying to figure out what we might possibly be doing wrong. This is a HUGE problem for us.
We're having the same issue here -- please let us know how to move forward!
Don't wanna pile on @radko93 but since he's the only RN rep on this thread -- can this please get prioritized? As you can see this is affecting many people at this point.
<3
Same issue for my team. Thank you for starting this thread. We upgraded to 61.2 and our app is constantly relaunching.
@JustinPerez are you seeing this on iOS 12 or just 13?
I will try to bring more attention but I cannot really promise anything right now.
iOS 13.2 released, interesting is this issue still exists on it? Will check
Just so you are aware, this isn't only RN apps problem, Apple changed something in the latest iOS versions so it kills apps very quickly https://twitter.com/marcoarment/status/1189213173439696900
I’m not saying Apple hasn’t done something differently, but there is an issue in RN as well. By simply rolling back from 0.61.2 to 0.60.5 our app no longer crashes on ios 13 after 10 seconds in the background.
This is a really crazy issue that took me a lot of time to investigate.
I still haven't found the root cause, but I am pretty sure that it's related to "beginBackgroundTask" and "endBackgroundTask" inside RCTTiming, more detail here: https://forums.developer.apple.com/thread/85066
My temporary fix is replacing the file node_modules/react-native/React/Modules/RCTTiming.m with this one: https://gist.github.com/minhtc/78799bfb84c2d697034b9b53c4e01320
This fix is working on my production app.
@minhtc That's so awesome you got that far! Do you have to fork and publish your own version of React for that change?
@minhtc That's so awesome you got that far! Do you have to fork and publish your own version of React for that change?
It's just a temporary fix so I don't create a fork, I'm using patch-package to update all the changes of file inside node_modules/
@minhtc @bobber205 Guys, I have tested app on the latest iOS 13.2
My crash cannot be reproduced anymore. Also I don't receive crash reports from users on iOS 13.2
I think it was resolved on iOS system level
Terminated app in background is normal process for OS it not reproduce any crash reports.
@oleksandr-dziuban Just updated our iphone 11 to 13.2
Launched the app went a couple screen deep then started to take a couple photos + post on IG. Presss App Icon -- complete relaunch. Same actions taken on Android 10 (same build of app) stays on the same tab. Almost impossible to realistically get the app to do the same behavior on Android vs iOS it's simple. Even simple things like start editing in a text field, read a text via a push notification then swap back = reboot of app.
@minhtc thanks for investigating, this might be the commit that is causing this issue https://github.com/facebook/react-native/commit/338298417f8077dee177057c57b38671b4ec8c75#diff-29f34a4d1c9b73a44351941dae6056c8
Anyway known way (hard or easy) to disable that functionality for consumers who don't need it? 🙏
I submitted a PR to fix that for 0.61.x, You can upvote it there https://github.com/facebook/react-native/pull/27065 . If it gets merged then it will be available in 0.61.4.
Hi, anyone can try new a project(not include RN), just begin a background task to see wether it terminated by system? code like https://github.com/facebook/react-native/commit/338298417f8077dee177057c57b38671b4ec8c75#diff-29f34a4d1c9b73a44351941dae6056c8R150-R157.
I reviewed the timer module again, I may suspect there have thread-safe issue, @bobber205 @oleksandr-dziuban can you guys can help to dig in? Replace 3 methods in RCTTiming.m like https://github.com/facebook/react-native/pull/25164/files#diff-29f34a4d1c9b73a44351941dae6056c8R174-R202, and try wether it crashed on iOS 13.1. Thanks.
I can try next week
On Fri, Nov 1, 2019, 8:46 PM Wu Zhong notifications@github.com wrote:
I reviewed the timer module again, I may suspect there have thread-safe
issue, @bobber205 https://github.com/bobber205 @oleksandr-dziuban
https://github.com/oleksandr-dziuban can you guys can help to dig in?
Replace 3 methods in RCTTiming.m like
https://github.com/facebook/react-native/pull/25164/files#diff-29f34a4d1c9b73a44351941dae6056c8R174-R202,
and try wether it crashed on iOS 13.1. Thanks.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/facebook/react-native/issues/26696?email_source=notifications&email_token=ABMSBU74VOQGEJALVOSHKYDQRTZZLA5CNFSM4I44TOJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC4S52A#issuecomment-549007080,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABMSBU3CEMWRTSY3TS6BAOTQRTZZLANCNFSM4I44TOJQ
.
You can now try 0.61.4 as it includes a fix.
This is now fixed on 61 branch and on master.
Still having same issue. Works fine on simulators as well devices upto iPhone 8. For devices of X series, crash is happening still after 2-3 minutes
any other ideas what could cause this? Upgrading to .61.5 didn't fix this for me :/
@sarthak216-blr , @octodhruv are you guys using Websockets?
@vforvasile Nope - no websockets.
1- app closed (not in background)
2- received a notification
3- click app icon or click notification for launch
4- app crashes at didFinishLaunchingWithOptions. cause RCTCxxBridge _handleError.
5- kill app and launch again, app is opening without error !
can anyone help?
This is causing serious issues for us as well @radko93
@vforvasile @radko93 Hi. I'm curious why you asked if we are using Websockets. Could you provide more details on how would that cause the problem?
I have exactly the same issue and currently fix it with RN 0.61.5, but when using 0.61.4 sometimes unstable.
Most helpful comment
@oleksandr-dziuban
