React-native: Module AppRegistry is not a registered callable module

Created on 19 Jul 2018  路  9Comments  路  Source: facebook/react-native

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

OS: macOS High Sierra 10.13.4
Node: 9.11.2
Yarn: 0.27.5
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.4 Build version 9F1027a
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.2 => 0.55.2

Steps to Reproduce

1- For Android, setup release configurations.
2- react-native run-android --variant=releaseStaging
3- After the build is successful, the app is deployed to the connected device, then crashes with the following message (from cat logs):

--------- beginning of crash
false is not a function (evaluating 't(d)')
07-19 21:52:15.038  7212  7252 E ReactNativeJS: Module AppRegistry is not a registered callable module (calling runApplication)
AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
AndroidRuntime: Process: com.teambo, PID: 7212
AndroidRuntime: com.facebook.react.common.JavascriptException: false is not a function (evaluating 't(d)'), stack:
AndroidRuntime: <unknown>@343:502
AndroidRuntime: <unknown>@343:481
AndroidRuntime: e@327:267
AndroidRuntime: <unknown>@352:369
AndroidRuntime: d@2:768
AndroidRuntime: n@2:409
AndroidRuntime: t@2:262
AndroidRuntime: <unknown>@315:218
AndroidRuntime: d@2:768
AndroidRuntime: n@2:409
AndroidRuntime: t@2:262
AndroidRuntime: <unknown>@12:92
AndroidRuntime: d@2:768
AndroidRuntime: n@2:339
AndroidRuntime: t@2:262
AndroidRuntime: global code@883:8
AndroidRuntime: 
AndroidRuntime:     at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
AndroidRuntime:     at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
AndroidRuntime:     at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
AndroidRuntime:     at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:160)
AndroidRuntime:     at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:739)
AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)
AndroidRuntime:     at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
AndroidRuntime:     at android.os.Looper.loop(Looper.java:158)
AndroidRuntime:     at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
AndroidRuntime:     at java.lang.Thread.run(Thread.java:818)
ActivityManager:   Force finishing activity com.teambo/.MainActivity

4- Following are the dependencies in package.json file:

"dependencies": {
    "@mapbox/react-native-mapbox-gl": "git+https://github.com/mapbox/react-native-mapbox-gl#release/6.1.2",
    "@ptomasroos/react-native-multi-slider": "^1.0.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "moment": "^2.22.1",
    "moment-jalaali": "^0.7.2",
    "prop-types": "^15.6.1",
    "react": "16.3.1",
    "react-native": "0.55.2",
    "react-native-code-push": "^5.3.3",
    "react-native-dropdownalert": "^3.4.0",
    "react-native-elements": "^0.19.1",
    "react-native-google-analytics-bridge": "^5.6.3",
    "react-native-image-picker": "^0.26.7",
    "react-native-splash-screen": "3.0.6",
    "react-native-swiper": "^1.5.13",
    "react-native-vector-icons": "^4.6.0",
    "react-navigation": "^1.5.11",
    "react-navigation-redux-helpers": "^1.0.5",
    "react-redux": "^5.0.7",
    "redux": "^3.7.2",
    "redux-logger": "^3.0.6",
    "redux-promise-middleware": "^5.0.0",
    "redux-thunk": "^2.2.0",
    "rn-viewpager": "^1.2.9"
  },

5- actually I'm using code-push for my app. here is my index.js

import codePush from 'react-native-code-push';
import { AppRegistry } from 'react-native';
import App from './src/App/App';

const codePushOptions = {
  checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
  installMode: codePush.InstallMode.ON_NEXT_RESUME,
};

const pushedApp = codePush(codePushOptions)(App);

AppRegistry.registerComponent('Teambo', () => pushedApp);

Expected Behavior

Application should run on the device without any crashes (in release mode).

Actual Behavior

Application works fine when using react-native run-android but when I try to release it application builds successfully and deploys onto device. Then the app crashes once it opens.

Reproducible Demo

Unable to create a reproducible demo.

Android Locked

Most helpful comment

I have upgraded the React Native to 0.59.8
And using codepush
I am getting the same error on both Android and iOS...

[fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

Please help me.

All 9 comments

It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?

@react-native-bot

Environment

OS: macOS High Sierra 10.13.4
Node: 9.11.2
Yarn: 0.27.5
npm: 5.6.0
Watchman: 4.7.0
Xcode: Xcode 9.4 Build version 9F1027a
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.2 => 0.55.2

https://github.com/facebook/react-native/issues/18179 might be related. I'm closing this issue as there is no minimal repro, and this appears to be unique to your particular application.

simulator screen shot - iphone 6 - 2019-01-03 at 12 48 50

I got same issue when using react-natve: 0.57.8 react: 16.6.3 when i imported an typescript react-native component
ENV:

React Native Environment Info:
    System:
      OS: macOS 10.14.2
      CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 45.46 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.15.0 - ~/.nvm/versions/node/v10.15.0/bin/node
      Yarn: 1.12.3 - ~/.nvm/versions/node/v10.15.0/bin/yarn
      npm: 6.5.0 - ~/.nvm/versions/node/v10.15.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        API Levels: 23, 27, 28
        Build Tools: 23.0.1, 27.0.3, 28.0.3
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5056338
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: 0.57.8 => 0.57.8

I have upgraded the React Native to 0.59.8
And using codepush
I am getting the same error on both Android and iOS...

[fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

Please help me.

After upgraded react native version 0.59.9 and i'm facing the same issue on both android and ios.

Same. React-native 0.59.9, macOS 10.14.5, xcode 10.2.1, node 10.15.3

I have tried react-native link, --reset-cache, rebuilding.

Here is my index.js:

/**
 * @format
 */

import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import PushNotification from 'react-native-push-notification';

PushNotification.configure({

    // (optional) Called when Token is generated (iOS and Android)
    onRegister: function(token) {
        console.log( 'TOKEN:', token );
    },

    // (required) Called when a remote or local notification is opened or received
    onNotification: function(notification) {
        console.log( 'NOTIFICATION:', notification );

        // process the notification

        // required on iOS only (see fetchCompletionHandler docs: https://facebook.github.io/react-native/docs/pushnotificationios.html)
        notification.finish(PushNotificationIOS.FetchResult.NoData);
    },

    // ANDROID ONLY: GCM or FCM Sender ID (product_number) (optional - not required for local notifications, but is need to receive remote push notifications)

    // IOS ONLY (optional): default: all - Permissions to register.
    permissions: {
        alert: true,
        badge: true,
        sound: true
    },

    // Should the initial notification be popped automatically
    // default: true
    popInitialNotification: false,

    /**
      * (optional) default: true
      * - Specified if permissions (ios) and token (android and ios) will requested or not,
      * - if not, you must call PushNotificationsHandler.requestPermissions() later
      */
    requestPermissions: true,
});

AppRegistry.registerComponent(appName, () => App);

@hramos this issue seems to be occurring lately. Should we reopen?

Was this page helpful?
0 / 5 - 0 ratings