React-native: [iOS] Simulator error message `Unable to find module for DevLoadingView`

Created on 31 Jan 2019  Â·  31Comments  Â·  Source: facebook/react-native

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
Memory: 2.85 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 5.6.0 - ~/.nvm/versions/node/v8.10.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:
Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.1, 27.0.3, 28.0.2, 28.0.3
API Levels: 23, 25, 26, 27
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.3 => 0.58.3
npmGlobalPackages:
react-native-git-upgrade: 0.2.7

Description

Recently upgraded to RN 0.58.3 (from 0.57.8) via react-native-git-upgrade. Everything compiles just fine.

However, invoking a debug run via react-native run-ios will result in an immediate error message:

error

Notes:

  • Reloads (cmd-R) of a running app clear the error. (App runs as expected)
  • Subsequent reloads (cmd-R) of already running app do not trigger the error. (App runs as expected)
  • Closing either the simulator itself and restarting, OR closing the running app within the simulator session and relaunching will trigger the error once again.
  • Each of the 0.58.0, 0.58.1, 0.58.2, 0.58.3 releases give the same results.

Reproducible Demo

In my case it was simply upgrading to RN 0.58.3 from 0.57.8 via react-native-git-upgrade then running react-native run-ios to encounter the error message.

Bug RC Author Provided Repro iOS Locked

Most helpful comment

@superguineapig I just hit this too. Fixed by going to the simulator menu and hitting Hardware > Erase All Content and Settings... then Hardware > Restart. Hardware restart might not be necessary...I think the simulator restarts anyway after clearing stuff.

Now I've got a new error to solve about a missing Pod :), but thats specific to my project.

All 31 comments

@superguineapig I just hit this too. Fixed by going to the simulator menu and hitting Hardware > Erase All Content and Settings... then Hardware > Restart. Hardware restart might not be necessary...I think the simulator restarts anyway after clearing stuff.

Now I've got a new error to solve about a missing Pod :), but thats specific to my project.

Awesome, good luck with your Pod hunt!

For those building to a device: I had the same issue on my iPhone (XR) rather than in simulator, solution was to delete the app through the phone and then re-trust the developer in Settings > General > Device Management.

Thanks @snobear ! That seems to have (EDIT: temporarily) cleared it up.

(Aside: I had some (unrelated to this issue) Pod troubles after using react-native-git-upgrade Long story short, I needed to do a pod install then pod update again after each upgrade to restore something that got reset in the process. I didn't notice the changes at first because they were not being tracked by my git setup. Anyway, thanks again, and good luck!)

EDIT: The error seems to be intermittent, even after resetting the simulator.

I got it to work as well. All I had to do was disable the remote debugger.

When the simulator failed, I opened the tools with Command + D and disabled the debugger.

@samcorcos how am i suppose to disable the disable the debugger?

@Utkarshmalik For ios simulator press cmd+D it will open up popup from there you can disable the debugger. For Android press cmd+m to do the same.

Why are you disabling the debugger? What if you want to debug?

@algera You can disable it, then re-enable it. It would appear it just needs to be toggled off when you're starting up.

The same issue on a real device. Seems like an application starts before js bundle is created

Update: Still seeing the error intermittently a few days after following the simulator reset procedure above (https://github.com/facebook/react-native/issues/23235#issuecomment-459579584) Typically only when the simulator itself is launched and is not already running before opening the target app.

Seems like a bug in RN 0.58.3, I'm seeing this in a freshly created project.

I deleted the app from the simulator, stopped the packager and then cleaned my build folder and then built again. The error came back after the app was installed again and I tried to debug but stopping the debugger, refreshing the browser then restarting the debugger got rid of the error and I was able to debug and see console messages after that.

Getting this on RN58.4 - pretty annoying.

This is happening as a part of the latest 0.59.0-rc1 as well.

Steps to reproduce:

  1. Init a project with react-native init
  2. Run in simulator/device
  3. Once RN screen loads, enabled JS debugging
  4. (IMPORTANT) Close the app
  5. Open the app again
  6. You will see the redbox error

The error for the redbox was added in https://github.com/facebook/react-native/commit/d7a0c44590bcf3fb9d055aeae3391d5bcd7e21be but that in itself is a part of a series of commits for lazy loading native modules by @fkgozali.

Note: This error is non blocking. iiuc, you can dismiss the red box and your RN screen will still be loaded behind it.

@kelset Do you have any ideas how we can get this issue resolved?

I've managed to resolve the red box by making this change: https://github.com/karanjthakkar/ReactNativeDevLoadingViewIssue/commit/e1a637cd82bf45e6af6814746d863b131b76ac62

NOTE: THIS IS A HACK. It only works for 0.59.0-rc.0 and upwards. That is because they use initWithDelegate to initialise the RN bridge.

For folks on an older version(<= 0.58), please do these two things:

  1. Replace your AppDelegate.m with this file: https://github.com/facebook/react-native/blob/da5b5d2fa134aa09dda4a620be9fa4d3d419201f/template/ios/HelloWorld/AppDelegate.m. After replacing, remember to update the moduleName from HelloWorld to whatever is there in your app.json
  2. Replace your AppDelegate.h file by this one: https://github.com/facebook/react-native/blob/da5b5d2fa134aa09dda4a620be9fa4d3d419201f/template/ios/HelloWorld/AppDelegate.h
    NOTE: If you're replacing any files, make sure you copy any custom code you added to it in the past.

Why this fix works?

By returning YES from the bridge:didNotFindModule method, it enters the if condition here instead of going to the else condition where it runs into the error.

Thanks for reporting this, I've flagged this as something we should address before 0.59 hits stable.

This should be fixed with this commit: https://github.com/facebook/react-native/commit/a9dd828c68338dbf0e55ffa1838bf8ff574f317d -- will be picked to the RC branches

Closing this issue. Please re-open as needed.

@fkgozali I'm still seeing this issue on real device (ios), with react native 0.59.3.
It must be something else going on.

@karanjthakkar fix worked for me like a miracle

I still have the same issue on react-native 0.59.8. I tried Erase All Content and Settings and no success. In remote JS debugging mode if I reload the app, the app throws the error.

Issue occurring here also. React Native 0.59.8 (Expo SDK 33), with iOS on iPhone (not simulator). Reloading the bundle works, but on reload after a change this comes up sporadically.

Issue occurring here also. React Native 0.59.8 (Expo SDK 33), with iOS on iPhone (not simulator). Reloading the bundle works, but on reload after a change this comes up sporadically.

Same, 0.59.9, iOS simulator with debugging + hot reload ON

0.59.10 still have this problem.

Still seeing it on 0.60.4

Same here on 0.60.4.

+1 Same error on 0.60.4

still getting this error after updating and resetting device as well.

does anyone know if this problem will effect the delivered app after development? or is it only when building on computer?

First time encountered this after upgrading from 0.59.10 to 0.60.4. In my case it happens when I try to refresh (⌘ + R) iOS simulator.

"Reload", than its ok

@dongcaiying Yes, after refreshing it on the error screen it works. But then you have to refresh 2 times. This answer on stack overflow solved the issue for me.

Was this page helpful?
0 / 5 - 0 ratings