Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
This repository was archived by the owner on May 20, 2025. It is now read-only.

App crashing after restart on Android with react-native-navigation when starting app after AsyncStorage access #1088

@jer-sen

Description

@jer-sen

Steps to Reproduce

  1. Install and configure last versions of react-native-code-push and react-native-navigation
  2. Set index.js as following:
import { AsyncStorage } from 'react-native';
import { Navigation } from 'react-native-navigation';
import React from 'react';
import { Text } from 'react-native';
import codePush from "react-native-code-push";

const App = () =>
	<Text onPress={() => codePush.restartApp(false)}>
		Touch to run codePush.restartApp and see the crash
	</Text>
;

AsyncStorage.getItem('environment', () => {
	Navigation.registerComponent('app', () => App);
	Navigation.startSingleScreenApp({
		screen: {
			screen: 'app',
		},
		passProps: { },
	});
});
  1. Build and run Android app
  2. Tap to restart app

Expected Behavior

App restarts

Actual Behavior

App crashes with error:

Module AppRegistry is not a registered callable module (calling runApplication)

It's similar to #852
It also crashes after an immediate update.

Reproducible Demo

Cf repro steps.

Environment

+-- react@16.0.0
+-- react-native@0.50.4
+-- react-native-code-push@5.2.0-beta
+-- react-native-navigation@1.1.295

  • iOS/Android/Windows version: Android only
  • Does this reproduce on a debug build or release build? release only
  • Does this reproduce on a simulator, or only on a physical device? on both

I really need to access AsyncStorage before starting the app to decide which screen display to the user.
Thanks for your help !

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions