Detached, unmodified app crashes on startup

#1

Hi,

I get this error message when I start up the app:

AppRegistry is not a registered callable module

I know this error message is quite common/infamous, but please bear with me. I’ve been googling this for days and I’ve tried every solution I’ve found, but nothing seems to work.

The app is completely unmodified, meaning I haven’t changed a single line of code. So the error shouldn’t (cannot?) be in my codebase.

So what I’ve done is basically this:

  1. "create-react-native-app "
  2. “yarn run eject” inside the app folder
  3. “pod install” inside the ios folder. I haven’t been using android studio at all yet.
  4. Inside XCode I deactivate “parallelise build” and add React as a target above my own project.
  5. I kept getting linking errors about some WebSocket library, so I added it according to the manual instructions here.

After doing that, it builds just fine in XCode. But when I launch it in the simulator, this happens:

2018-02-20 15:44:55:958 cf-mobile[49330:3469310] Expo Remote Notification services won't work in an ExpoKit app because Expo can not manage your APNS certificates.
2018-02-20 15:44:56:119 cf-mobile[49330:3469310] 2018-02-20 15:44:56.117 [warn][tid:main][RCTBridge.m:120] Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-02-20 15:44:56:120 cf-mobile[49330:3469310] 2018-02-20 15:44:56.121 [warn][tid:main][RCTBridge.m:120] Class RCTDevMenu was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-02-20 15:44:56:121 cf-mobile[49330:3469310] 2018-02-20 15:44:56.122 [warn][tid:main][RCTBridge.m:120] Class EXTest was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-02-20 15:44:56:122 cf-mobile[49330:3469310] 2018-02-20 15:44:56.122 [warn][tid:main][RCTBridge.m:120] Class EXFrameExceptionsManager was not exported. Did you forget to use RCT_EXPORT_MODULE()?
2018-02-20 15:44:56:162 cf-mobile[49330:3469310] 2018-02-20 15:44:56.162 [warn][tid:main][RCTModuleData.mm:69] Module EXGLObjectManager requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
2018-02-20 15:44:56:162 cf-mobile[49330:3469310] 2018-02-20 15:44:56.162 [warn][tid:main][RCTModuleData.mm:69] Module EXGLViewManager requires main queue setup since it overrides `init` but doesn't implement `requiresMainQueueSetup`. In a future release React Native will default to initializing all native modules on a background thread unless explicitly opted-out of.
2018-02-20 15:44:57:098 cf-mobile[49330:3469703] 2018-02-20 15:44:57.098 [error][tid:com.facebook.react.JavaScript] Native module cannot be null.
2018-02-20 15:44:57:104 cf-mobile[49330:3469697] 2018-02-20 15:44:57.105 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Native module cannot be null.
2018-02-20 15:44:57:190 cf-mobile[49330:3469703] 2018-02-20 15:44:57.190 [error][tid:com.facebook.react.JavaScript] Module AppRegistry is not a registered callable module (calling runApplication)
2018-02-20 15:44:57:192 cf-mobile[49330:3469690] 2018-02-20 15:44:57.192 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Module AppRegistry is not a registered callable module (calling runApplication)

I haven’t added a single library or changed code.
macOS 10.13.3
XCode 9.2

app.json

{
  "expo": {
    "sdkVersion": "25.0.0",
    "ios": {
      "bundleIdentifier": "se.mycompany.cfmobile",
      "publishBundlePath": "ios/cf-mobile/Supporting/shell-app.bundle",
      "publishManifestPath": "ios/cf-mobile/Supporting/shell-app-manifest.json"
    },
    "android": {
      "package": "se.mycompany.cfmobile"
    },
    "name": "cf-mobile",
    "slug": "cf-mobile",
    "version": "0.1.0",
    "isDetached": true,
    "detach": {
      "scheme": "exp02033d8bf6a84eed897b3f6851499309",
      "iosExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.3.3-sdk25.0.0-e7a4361a-631d-4caf-9692-1880d71c394a.tar.gz",
      "androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.3.0-sdk25.0.0-0c32461b-a7c6-4ddc-b85b-32a80c4f18d9.tar.gz"
    }
  }
}

package.json

{
  "name": "cf-mobile",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "jest-expo": "25.0.0",
    "react-test-renderer": "16.2.0"
  },
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "test": "node node_modules/jest/bin/jest.js"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "expo": "^25.0.0",
    "react": "16.2.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz"
  }
}

I’m new to this so there’s probably something very basic I’m missing here, but I’m tearing my hair off trying to figure this out. Help? :slight_smile:

#2

Hey there, I’m not sure I understand this comment: “I haven’t added a single library or changed code” when it sounds like you did exactly that in steps 4 and 5. Neither of those steps should have been necessary to get the project running. Have you followed this guide?

#3

I absolutely did. When I followed that guide, I got linking errors:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTSRWebSocket", referenced from:
      objc-class-ref in libReact.a(RCTInspectorPackagerConnection.o)
  "_OBJC_CLASS_$_RCTReconnectingWebSocket", referenced from:
      objc-class-ref in libReact.a(RCTPackagerConnection.o)

That’s why I added libRCTWebSocket manually. What I meant with not having added any libraries was that I haven’t added anything to package.json (or any other file).

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.