requestIdleCallback crashing on Android app launch (mReactChoreographer)
See original GitHub issueProblem
When requestIdleCallback
is called outside of a Component at start, such as prior to AppRegistry getting called, results in an assertion failure within Timing.java (line 287). This is due to mReactChoreographer
being null inside Timing#setChoreographerIdleCallback
, because it is being executed prior to Timing#initialize
is getting called (which sets mReactChoreographer
by retrieving the singleton).
This error can be replicated with this index.android.js
:
import React, {Component} from 'react'
import {AppRegistry, Text} from 'react-native'
requestIdleCallback(() => console.log('If this works, it\'s not broken :)')) // This will trigger the force close
AppRegistry.registerComponent('Broken App', () => () => <Text>Hello</Text>)
Related
requestIdleCallback
was implemented on Android in this PR https://github.com/facebook/react-native/pull/8569. I don’t believe that it has been updated since (as far as I could tell from a quick diff b/w v0.31 and master).
Environment
- React Native: 0.31
- Dev OS: macOS
- App Environment: Android Emulator, Intel x64, 6.0
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Why do my apps keep crashing on Android, How to fix it
Another way to fix apps crashing on your phone is to simply restart the device. Restarting the device will kill and then restart...
Read more >Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >What to Do If Apps Keep Crashing on an Android Device
1. Start the Settings app. · 2. Tap Apps & notifications. · 3. Find the crashing app in the list of apps. You...
Read more >Why Do My Apps Keep Crashing on Android? - Avast
Do your Android apps keep crashing? Discover why and learn how to prevent Android apps crashing and freezing by following these methods.
Read more >How to Fix the Google App Crashing on Android - MakeUseOf
Examples include phones with low storage space, inadequate internals to run the apps, or simply a corrupt app installation. Google apps ...
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 Free
Top 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
@awendland Thanks for the detailed report, I’ll take a look at it soon.
https://snack.expo.io/SJNxdKDAb @idibidiart