不变违规:TurboModuleRegistry.getEnforcing(...):找不到“ DevSettings”

时间:2020-01-13 09:10:44

标签: react-native react-native-ios

应用程序因上述消息而崩溃。无法查看我的应用程序屏幕。

不变违规:TurboModuleRegistry.getEnforcing(...):找不到'DevSettings'。验证使用此名称的模块已在堆栈中注册...

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

4 个答案:

答案 0 :(得分:3)

我有同样的错误,问题是我以发布模式构建了该应用程序,但是main.jsbundledev模式。

使用react-native@0.61.5

我停止了Metro流程,然后再次运行

react-native run-ios --configuration Release --device --scheme="MyTargetScheme"

答案 1 :(得分:1)

对我们来说,问题是我们(手动)为生产应用构建了RN捆绑包,而没有在dev CLI中设置react-native值。

在具有Xcode中调试配置的模拟器或设备上进行测试时,这不是问题。但是由于我们使用发布配置为App Store存档,所以我们在生产中看到了崩溃。

react-native bundle命令的--dev开关默认设置为true。因此,解决方案就是将--dev false添加到bundle命令中。

答案 2 :(得分:0)

就我而言,我的问题通过节点-v更改得以解决。

最初,我使用节点9.4.0,然后将其更改为12。

Due to this version change the above error occurs.

因此,我已更改为节点9.4.0并在发布模式下重建该应用程序。效果很好

任何人都知道为什么节点版本更改未能将应用程序捆绑为发布模式

答案 3 :(得分:0)

在我的特定情况下,我使用的是 expo/ex-navigation 的弃用版本,在 RN 0.64.2 中我们遇到了一个问题,因为 RN 不理解 @2x.android 或类似的强制转换来选择正确的图像对于一个图标。问题描述如下:#31348

我在 node_modules 中本地出售我的冲突并使 Android 工作正常(然后我分叉并在我的控制下创建一个更正),但是当我回到我的 IoS 问题时,我忘记使用这个更正。

因此,我的问题发生在我的 node_modules 中的一个库中,并且经过广泛搜索,这种问题经常发生在这种情况下。

因此,如果@takameyer 解决方案不起作用,因为它对我不起作用,我建议您查看您的 node_modules 依赖项...

可能试图构建你的包,认为 react-native-cli 会给你一个更好的日志然后在 xcode 中构建它,因为在我的情况下 xcode 构建工作但给我一个运行时错误(发布)。

我希望它在未来对某人有所帮助。