React-native: 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.

Created on 24 Oct 2019  路  40Comments  路  Source: facebook/react-native

I tried to add new schemas to ios project. I added Staging-Debug copied from default Debug schema. When application is loading I catch the next error:

2019-10-24 15:43:05.427 [error][tid:com.facebook.react.JavaScript] Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
2019-10-24 15:43:05.430 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
2019-10-24 15:43:05.433396+0300 HelloGuest[3076:1701296] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.', reason: 'Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the na..., stack:
getEnforcing@4947:28
<unknown>@41941:50
loadModuleImplementation@271:14
<unknown>@41900:40
loadModuleImplementation@271:14
<unknown>@36481:18
loadModuleImplementation@271:14
<unknown>@29159:16
loadModuleImplementation@271:14
guardedLoadModule@163:47
global code@375133:4

React Native version:

System:
OS: macOS 10.15
CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
Memory: 110.47 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.3 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 23, 24, 26, 27, 28
Build Tools: 23.0.1, 27.0.3, 28.0.2, 28.0.3
System Images: android-24 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-create-library: 3.1.2
react-native-git-upgrade: 0.2.7

Why can it happen?

Settings Bug

Most helpful comment

@mykhailo-melnyk

  1. No Problem:
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'MyApp' do
  project 'MyApp', 
  'Staging-Debug' => :debug,
  'Staging-Release' => :release,

  # Pods for HBAPP
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_native_modules!

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'react-native-config'
      phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
       phase.shell_script = "cd ../../"\
        " && RNC_ROOT=./node_modules/react-native-config/"\
        " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
        " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

       target.build_phases << phase
       target.build_phases.move(phase,0)
    end
  end
end
  1. I was previously using react-native-scheme-manager to do this in older version of RN. What this did was go through every xcodeproj file that existed in node_modules and wrote all my projects build configurations in them (at least that is my rough understanding).
    What the Podfile does is quite similar, except it does no rewriting. It basically says take the build configuration "Staging-Debug" and handle it as if it were the build configuration "debug" in all the Pod dependencies. That is also only my rough understanding of how it works.

  2. Yes. I would recommend a complete reinstall of everything:

> rm -rf node_modules
> yarn
> cd ios
> pod install

Another caveat, if you, like me, are coming from using 'react-native-scheme-manager", uninstall this completely using the instructions from https://github.com/thekevinbrown/react-native-schemes-manager#uninstalling
In my case this was no longer necessary to have and only caused more problems migrating from RN 59 -> 61

All 40 comments

I have the same issue with you :(

Same here!

Same here!

Same here!

In my case, i got this error only when trying to run debug build on device.
If i try to run on simulator - i am getting "No Bundle URL Present."
It is not connect to development server for js bundle.
After debugging finally realized that RCT_DEV not setted for debug builds in my new schema.

After some workaround like adding RCT_DEV=1 in Preprocessor flags,
started to get only error "TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found."
in simulator also.

Workaround for me

  1. renamed back my "DEMO Debug" config to "Debug"
  2. changed my schemes accordingly
  3. also fixed "React(missing)" in Build part of schemes.

小薪懈屑芯泻 褝泻褉邪薪邪 2019-10-29 胁 12 31 00
(Delete the React (missing), click on the + on the bottom left, add React (from pods section). Finally, check all the checkboxes and place React at the top of the list.)

Now debug build working as expected, but i cant use different configs for different schemas, only 1 "Debug".

@maullerz yes, you are right but I want to use a different configuration for different schema
=(

Getting this too, any ideas?

Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.

It's fine for me on dev with Debug config but using our Staging configuration, app builds but then crashes and I see this :(

Getting this too, any ideas? ...

@Jonovono so in my case I was actually only getting this on the Staging scheme, Local and Prod worked fine.
The issue was that debug was on for Staging, even though it鈥檚 supposed to behave like a release build. Now that I build Staging release it works fine.

Sent with GitHawk

Make sure your bundle command includes --dev false if you're building for release

For example:
react-native bundle --entry-file index.js --dev false --reset-cache --bundle-output main.jsbundle

@corneelius where can I find these settings if I run project using Xcode?

In Build Phases, there is a phase called Bundle React Native Code and Images. That runs a script that creates the bundle for release builds. It fails for me most of the time. I commented it out and created the bundle manually by running this:

react-native bundle --entry-file index.js --dev false --reset-cache --bundle-output main.jsbundle

After that, drag the bundle into the Xcode project and try running again in release mode.

any updates on this?

I was able to solve this in my Podfile

target 'MyApp' do
  project 'MyApp',
  'Staging-Debug' => :debug,
  'Staging-Release' => :release,
  ...

This ensures that your build configuration is marked as "debug" or "release" in the underlying Pod xcode projects (including react-native).

Reference:
https://guides.cocoapods.org/syntax/podfile.html#project

@takameyer Thank you for your solution, this works perfectly for my version of the issue!

For anyone with a similar issue to mine, this might be helpful:
I've been on this issue way too long updating from 0.59 -> 0.61.4 and switching from manually linked packages to using cocoapods.

In my case the issue already presented it before this with 'No bundle url present' because preprocessing-variable RCT_DEV was automatically set to 0. Only after finding a workaround for that issue (setting the jsBundleLocation in AppDelegate.m to a hardcoded value in case it was nil) I got the issue seen above.

We are using react-native-schemes-manager which previously solved this issue automagically.

@takameyer
1) Could you please show full pod file?
2) What does this sentence mean?
"This ensures that your build configuration is marked as "debug" or "release" in the underlying Pod xcode projects (including react-native)."
3) Should we do some "pod install" after changed pod file?

@mykhailo-melnyk

  1. No Problem:
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'MyApp' do
  project 'MyApp', 
  'Staging-Debug' => :debug,
  'Staging-Release' => :release,

  # Pods for HBAPP
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_native_modules!

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'react-native-config'
      phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
       phase.shell_script = "cd ../../"\
        " && RNC_ROOT=./node_modules/react-native-config/"\
        " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
        " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

       target.build_phases << phase
       target.build_phases.move(phase,0)
    end
  end
end
  1. I was previously using react-native-scheme-manager to do this in older version of RN. What this did was go through every xcodeproj file that existed in node_modules and wrote all my projects build configurations in them (at least that is my rough understanding).
    What the Podfile does is quite similar, except it does no rewriting. It basically says take the build configuration "Staging-Debug" and handle it as if it were the build configuration "debug" in all the Pod dependencies. That is also only my rough understanding of how it works.

  2. Yes. I would recommend a complete reinstall of everything:

> rm -rf node_modules
> yarn
> cd ios
> pod install

Another caveat, if you, like me, are coming from using 'react-native-scheme-manager", uninstall this completely using the instructions from https://github.com/thekevinbrown/react-native-schemes-manager#uninstalling
In my case this was no longer necessary to have and only caused more problems migrating from RN 59 -> 61

@takameyer
thanks a lot!
it really helped in my case ( I also removed using react-native-scheme-manager)

Unfortunately we are still receiving this error. We are building a fresh app on 0.61.4.

Error:

[fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
libc++abi.dylib: terminating with uncaught exception of type NSException

Podfile:

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'MyApp' do
  # Custom Configs
  project 'MyApp',
  'Debug (Staging)' => :debug,
  'Debug (Production)' => :debug,
  'Release (Staging)' => :release,
  'Release (Production)' => :release

  # Pods for MyApp
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'


  # Firebase
  pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
  pod 'RNFBDatabase', :path => '../node_modules/@react-native-firebase/database'
  pod 'RNFBAuth', :path => '../node_modules/@react-native-firebase/auth'

  pod 'ReactNativeNavigation', :podspec => '../node_modules/react-native-navigation/ReactNativeNavigation.podspec'

  pod 'react-native-intercom', :path => '../node_modules/react-native-intercom'

  ## PERMISSIONS
  permissions_path = '../node_modules/react-native-permissions/ios'
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"
  pod 'Permission-Notifications', :path => "#{permissions_path}/Notifications.podspec"
  pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary.podspec"

  use_native_modules!
end

We have done several full removals and reinstalls of the pods including the lockfile. Not sure where to go from here, any help would be _greatly_ appreciated.

@luskin How were your build configurations generated? Have you tried making a new one by duplicating 'Debug' and 'Release' from the Project -> Info tab?
image
I would attempt this again and try and build only with that configuration. If that works then generate the rest in the same manner.

Also I would double check the Scheme to make sure the correct build configuration is selected for the Run step.

@takameyer Yes, this is how I created the additional configurations. I duplicated Debug and Release to create the new Staging and Production debug and release configurations.

UPDATE: I have actually removed all other build configurations and reverted back to the default Debug and Release configs and we are still receiving the error: 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary. after any codepush update restart.

Our issue is related to this issue: https://github.com/microsoft/react-native-code-push/issues/1704

UPDATE: Downgrading react-native to 0.60.5 fixed our issues.

This error occurs because the native implementation of ExceptionsManager wasn't found. As I make these NativeModules TurboModule-compatible, anything that lies in the following paths will be moved to CoreModules:

[
    "React/Base/**/*.m",
    "React/Base/**/*.mm",
    "React/DevSupport/**/*.m",
    "React/DevSupport/**/*.mm",
    "React/Inspector/**/*.m",
    "React/Inspector/**/*.mm",
    "React/Modules/**/*.m",
    "React/Modules/**/*.mm",
    "React/Profiler/**/*.m",
    "React/Profiler/**/*.mm",
    "React/Profiler/**/*.S",
    "React/UIUtils/*.m",
    "React/Views/**/*.m",
    "React/Views/**/*.mm",
    "Libraries/ActionSheetIOS/*.m",
    "Libraries/WebSocket/*.m",
]

To anyone who has this problem, does depending on the React-CoreModules pod fix the problems?

@RSNara to confirm, you are recommending updating the Podfile to include:

pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'

If so I will re-update the app to RN 0.61.4, include this pod and report back

_UPDATE:_ It turns out that the React-CoreModule pod dependency is already included in 0.61.4 (see here) - I will attempt this again but we attempted this before on a fresh installation of 0.61.4 so I'm not hopeful.

@luskin @RSNara I've had the React-CoreModule in my pod since September 18th, both before and after experiencing this issue.
image

I had this problem, but turns out I wasn't using the correct build configuration name.

If you're working on a brownfield app like me, here's where you can see the exact build configuration names in the scheme editor:

Screen Shot 2019-11-20 at 12 01 06 PM

Make sure they match up exactly in your podfile:

Screen Shot 2019-11-20 at 12 03 01 PM

After getting those to match, everything started working on RN 0.61.4.

@treyp - We reverted any custom schemes and are back to the classic Debug/Release schemes, so this doesn't apply to us.

@RSNara - We upgraded back up to 0.61.4 from 0.60.5 to re-attempt your proposed solution but it does not work. We are still receiving the error.

Removing the --development flag from my codepush release build process resolved this error for me.

@ahartzog You seemed to have solved the issue! We were using the --dev flag to deploy to our staging environment but removing that and setting the destination like you advised solved the issue. THANK YOU!

Awesome, glad to hear that. I'd write a PR to update the docs that this is an issue with 0.61+ but...it wouldn't get merged so...

You can follow this link for a clear explanation: Multiple schemes in RN apps

@takameyer I am getting the same error. How can I resolve this? I tried the following

react-native bundle --entry-file ./index.js --platform ios --bundle-output ios/main.jsbundle --assets-dest ios

But it not worked for me. Again I am getting

'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.

ahartzog Where i need to remove the development flag. Is it mandatory to add the custom config scheas in podfile

The above is fixed for me after changing the node -v as before.

I have used node -v 9.4.0 and again changed to 12.0. So I got above error.

To resolve this I have moved to the old one 9.4.0 and it get solved

Any updates on this issue? It's preventing us from using RN in our existing app - Bundling and accessing it as an asset works, but it's hurting productivity big time because we can load from local metro bundler service, or do any debugging.

I was able to solve this problem, move custom configurations in Podfile above target section.
image

I'm not using custom configurations, we only have Debug|Release schemas.

I've been trying with 0.62.2, and 0.63.2, but still having instant crash when run on release mode or when testers got new build from testflight.

2020-08-04 10:14:38.514908-0500 RNCliDagM8[67965:1042593] [] nw_socket_handle_socket_event [C3.1:1] Socket SO_ERROR [61: Connection refused] 2020-08-04 10:14:38.515 [error][tid:com.facebook.react.JavaScript] Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary. 2020-08-04 10:14:38.516991-0500 RNCliDagM8[67965:1042593] [] nw_socket_handle_socket_event [C3.2:1] Socket SO_ERROR [61: Connection refused] 2020-08-04 10:14:38.518256-0500 RNCliDagM8[67965:1042584] [] nw_connection_get_connected_socket [C3] Client called nw_connection_get_connected_socket on unconnected nw_connection 2020-08-04 10:14:38.518556-0500 RNCliDagM8[67965:1042584] TCP Conn 0x600003a84e40 Failed : error 0:61 [61] 2020-08-04 10:14:38.519 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary. 2020-08-04 10:14:38.552387-0500 RNCliDagM8[67965:1042593] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.', reason: 'Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the na..., stack:

I've been experiencing the same issue since I updated to Xcode 12.

Here is my react-native info output:

System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 4.21 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.2 - ~/.nvm/versions/node/v12.16.2/bin/node
    Yarn: Not Found
    npm: 6.14.4 - ~/.nvm/versions/node/v12.16.2/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      API Levels: 26, 27, 28, 29
      Build Tools: 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.3
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6392135
    Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_251 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.2 => 0.63.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Here is what happens when I try to run the scheme in Release mode.

libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.', reason: 'Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the na..., stack:
invariant@4555:25
getEnforcing@4826:27
<unknown>@35255:49
loadModuleImplementation@271:13
<unknown>@35165:61
loadModuleImplementation@271:13
<unknown>@34910:31
loadModuleImplementation@271:13
<unknown>@35943:35
loadModuleImplementation@271:13
<unknown>@27866:15
loadModuleImplementation@271:13
guardedLoadModule@163:46
global code@180966:3
'
terminating with uncaught exception of type NSException
(lldb) 

Important note is that I am able to run my build in Debug mode.

Update: I simply downloaded Xcode 11.6 and my release build continued to work.

@sameid didnt work for me..
Been 1y since this error first seen and still don't have clear solution?

A workaround.

  1. Comment iOS invariant assertion in NativeEventEmitter.js
diff --git a/node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js b/node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js
index 59e03aa..1a6bdbf 100644
--- a/node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js
+++ b/node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js
@@ -34,7 +34,9 @@ class NativeEventEmitter extends EventEmitter {
   constructor(nativeModule: ?NativeModule) {
     super(RCTDeviceEventEmitter.sharedSubscriber);
     if (Platform.OS === 'ios') {
-      invariant(nativeModule, 'Native module cannot be null.');
+      // COMMENTED AS PATCH: .... hell noway to fix DevSettings bug
+      // ref: https://github.com/facebook/react-native/issues/26987
+      // invariant(nativeModule, 'Native module cannot be null.');
       this._nativeModule = nativeModule;
     }
   }
  1. in iOS Pods project Build Settings, Set Processor Macros for Release as like
...
RCT_DEBUG=0
RCT_DEV=0
RCT_DEV_MENU=1
ENABLE_PACKAGER_CONNECTION=0

Hmm... It works for now.
My current env:

$ react-native info
info Fetching system and libraries information...
System:
    OS: macOS 10.15.6
    CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
    Memory: 982.60 MB / 40.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.2 - /usr/local/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0. - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.7, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 26, 27, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-26 | Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.2 Canary 11 4.2 Canary 11
    Xcode: 11.7/11E801a - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.5 - /Users/dw.kim/.sdkman/candidates/java/current/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: ^0.63.3 => 0.63.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found (It is )

Hello, this error took me a lot of time as well :(
so let me share the my solution, the problem is with the node_modules/react-native/scripts/react-native-xcode.sh for some reason is passing --dev true even in the release configurations. So i did a patched copy of the react-native-xcode.sh and copy it in the postintall script"

"$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \
  $CONFIG_ARG \
  --entry-file "$ENTRY_FILE" \
  --platform ios \
  --dev false \. // pass as false dev
  --reset-cache \
  --bundle-output "$BUNDLE_FILE" \
  --assets-dest "$DEST" \
  $EXTRA_PACKAGER_ARGS
Was this page helpful?
0 / 5 - 0 ratings