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

See original GitHub issue

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® Core™ 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?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:21
  • Comments:46 (3 by maintainers)

github_iconTop GitHub Comments

45reactions
takameyercommented, Nov 8, 2019

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

27reactions
takameyercommented, Nov 8, 2019

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not ...
I had the same error and the problem was that I built the app in Release mode but the main.jsbundle was dev mode....
Read more >
'DevSettings' could not be found-React Native
Coding example for the question Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found-React Native.
Read more >
DevSettings - React Native
The DevSettings module exposes methods for customizing settings for developers in development.
Read more >
'imageloader' could not be found. - You.com | The AI Search ...
facebook/react-native'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.#26987.
Read more >
TurboModuleRegistry.getEnforcing(...) error in react native
'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary. Invariant Violation: Module ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found