11

App get crashed with the above message. Unable to view my app screen.

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the na..., stack:

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

target 'App' do
  # Pods for App
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  #pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
  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 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'

  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'

  pod 'react-native-cameraroll', :path => '../node_modules/@react-native-community/cameraroll'

  target 'AppTests' do
    inherit! :search_paths
    # Pods for testing
  end

  use_native_modules!
end

target 'App-tvOS' do
  # Pods for App-tvOS

  target 'App-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
sejn
  • 2,040
  • 6
  • 28
  • 82
  • 1
    What scheme are you using to build in xcode? I have had this problem in the past due to an improper Podfile using custom builds (like staging-debug and release-debug). Can you post your Podfile? – Andrew Meyer Jan 13 '20 at 11:48
  • Indeed, I just had the same issue. My problem was exactly as @AndrewMeyer stated, my podfile project scheme maps were named differently than the actual scheme names. Changing them, pod cleaning, installing and building worked. Thanks – gbones Jan 14 '20 at 02:37
  • Already I have Release and Debug in my Scheme of Xcode. Now suddenly I got error with main.jsbundle not found so I run a react-native bundle command.But it shows the above message. – sejn Jan 14 '20 at 04:08
  • Is the custom config is good approach – sejn Jan 14 '20 at 04:52
  • @AndrewMeyer Updated my podfile above – sejn Jan 14 '20 at 06:44

5 Answers5

6

I had the same error and the problem was that I built the app in Release mode but the main.jsbundle was dev mode.

Using react-native@0.61.5

I stopped the Metro process and run again

react-native run-ios --configuration Release --device --scheme="MyTargetScheme"
strdr4605
  • 3,796
  • 2
  • 16
  • 26
4

For us the issue was that we were (manually) building the RN bundle for our production app without setting the dev value in the react-native CLI.

When testing on simulator or device with a debug configuration in Xcode, this was not a problem. But since we archive for the App Store with a release config, we were seeing this crash in production.

The react-native bundle command has the --dev switch set to true by default. So the solution was simply to add --dev false to the bundle command.

sumizome
  • 712
  • 8
  • 11
1

In my case, my issue is resolved by node -v changes.

Initially I have used node 9.4.0 and then I have changed the node to 12.

Due to this version change the above error occurs.

So I have changed to node 9.4.0 and rebuild the app in release mode. It works fine

Any one know why the node version changes failed to bundle the app in release mode

sejn
  • 2,040
  • 6
  • 28
  • 82
1

In my specific situation, I was using a deprecated version of expo/ex-navigation , in RN 0.64.2 we had one problem, because RN doesn't understood the @2x.android or similars casts to choose the right image for an Icon. The problem is Described here : #31348.

I sold my conflicts locally inside node_modules and make Android work fine (then I forked and create a correction under my control), but when I came back to work in my IoS problems, I forgot to use this correction.

So, my problem was occurring in one lib i had in my node_modules, and as I extensively searched, this problems use to happen in this kind of situation.

So if @takameyer solution doesn't work as it doesn't to me, I suggest taker a look in your node_modules dependencies...

probably trying to build your bundle thought react-native-cli will give you an better log then building this in xcode, since in my case xcode build worked but give-me a run-time error(Release).

I hope it help someone in the future.

Lord Caca
  • 21
  • 2
1

This crash reason is when your Target is Release Mode and your bundle is Development Mode.

So my iOS target was set to Release

And my bundle was build to Development, with this command :

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

So to fix this, i build again my bundle with this command.

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

And works.

Thanks @sumizome and @strdr4605 i made this with your answers.

Jackson Smith
  • 576
  • 4
  • 14