question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

requestIdleCallback crashing on Android app launch (mReactChoreographer)

See original GitHub issue

Problem

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:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
janicduplessiscommented, Aug 25, 2016

@awendland Thanks for the detailed report, I’ll take a look at it soon.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found