react-native: 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
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?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 21
- Comments: 46 (4 by maintainers)
I was able to solve this in my Podfile
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
@mykhailo-melnyk
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.
Yes. I would recommend a complete reinstall of everything:
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
I was able to solve this problem, move custom configurations in Podfile above target section.
Getting this too, any ideas?
It’s fine for me on dev with Debug config but using our Staging configuration, app builds but then crashes and I see this 😦
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.
Unfortunately we are still receiving this error. We are building a fresh app on
0.61.4
.Error:
Podfile:
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.
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.
Removing the --development flag from my codepush release build process resolved this error for me.
@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
andRelease
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
to0.60.5
fixed our issues.Well, I feel pretty dumb, but in my case it ended up being that I was using DevSettings in my index.js file, so I needed to make sure that code only ran in dev, like so:
I’ve been experiencing the same issue since I updated to Xcode 12.
Here is my react-native info output:
Here is what happens when I try to run the scheme in Release mode.
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.
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:
Make sure they match up exactly in your podfile:
After getting those to match, everything started working on RN 0.61.4.
Workaround for me
(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”.
This is just a workaround that might provide some relief. This worked on RN v0.62 but not RN v0.64
Do this only when building for none dev
Find this file
node_modules/react-native/Libraries/Utilities/DevSettings.js
comment out this line or delete this line
import NativeDevSettings from '../NativeModules/specs/NativeDevSettings';
comment out or delete this class:
modify this line
To
@takameyer thanks a lot! it really helped in my case ( I also removed using react-native-scheme-manager)
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 thereact-native-xcode.sh
and copy it in the postintall script"@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.
Same here!
I have the same issue with you 😦