-
Notifications
You must be signed in to change notification settings - Fork 24k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'DevSettings' could not be found. Verify that a module by this name is registered in the native binary. #26987
Comments
I have the same issue with you :( |
Same here! |
2 similar comments
Same here! |
Same here! |
In my case, i got this error only when trying to run debug build on device. After some workaround like adding |
@maullerz yes, you are right but I want to use a different configuration for different schema |
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 :( |
@Jonovono so in my case I was actually only getting this on the Staging scheme, Local and Prod worked fine. Sent with GitHawk |
Make sure your bundle command includes --dev false if you're building for release For example: |
@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: |
@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: 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. |
|
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
> 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 |
@takameyer |
Unfortunately we are still receiving this error. We are building a fresh app on Error:
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? 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 Our issue is related to this issue: microsoft/react-native-code-push#1704 UPDATE: Downgrading |
This error occurs because the native implementation of
To anyone who has this problem, does depending on the |
@RSNara to confirm, you are recommending updating the Podfile to include:
If so I will re-update the app to RN UPDATE: It turns out that the |
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. |
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 |
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'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.
|
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. |
@sameid didnt work for me.. |
A workaround.
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;
}
}
Hmm... It works for now.
|
Hello, this error took me a lot of time as well :(
|
This issue can be closed since it's podfile configuration - might want to add this to setup instructions |
This is still an issue, and I don't think it's just podfile configuration. In my case, I can see in my build output that the command being run is correct (e.g. |
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:
|
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 comment out this line or delete this line comment out or delete this class: class DevSettings extends NativeEventEmitter implements IDevSettings {
_menuItems: Map<string, () => mixed>;
constructor() {
super(NativeDevSettings);
this._menuItems = new Map();
}
addMenuItem(title: string, handler: () => mixed) {
// Make sure items are not added multiple times. This can
// happen when hot reloading the module that registers the
// menu items. The title is used as the id which means we
// don't support multiple items with the same name.
const oldHandler = this._menuItems.get(title);
if (oldHandler != null) {
this.removeListener('didPressMenuItem', oldHandler);
} else {
NativeDevSettings.addMenuItem(title);
}
this._menuItems.set(title, handler);
this.addListener('didPressMenuItem', event => {
if (event.title === title) {
handler();
}
});
}
reload(reason?: string) {
if (typeof NativeDevSettings.reloadWithReason === 'function') {
NativeDevSettings.reloadWithReason(reason ?? 'Uncategorized from JS');
} else {
NativeDevSettings.reload();
}
}
onFastRefresh() {
if (typeof NativeDevSettings.onFastRefresh === 'function') {
NativeDevSettings.onFastRefresh();
}
}
// TODO: Add other dev setting methods exposed by the native module.
} modify this line module.exports = ((__DEV__
? new DevSettings()
: new NoopDevSettings()): IDevSettings); To module.exports = (new NoopDevSettings(): IDevSettings); |
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 some one in the future. |
Appreciate all the discussion in this issue. Closing as there are multiple workarounds and ways to resolve this in the thread. |
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:
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?
The text was updated successfully, but these errors were encountered: