When I upgrade the v2.0.0-alpha.8 app stuck white screen on iOS simulator debug mode. I got this error in console; Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). Normal mode works as expected. Also v1.x has not this issue.
Same issue!
Kill the terminal/command prompt running your node JS and run your app again.
Kill the terminal/command prompt running your node JS and run your app again.
how do i do that
Hey! Please try to run this using xcode and seek for the console. There should be more detailed error message, you can analyse it yourself or just copy all of the output from there here.
FWIW I had the same issue (while upgrading to v2.9). As Ishmaell suggested, just kill the bundler and rebuild/rerun from xcode/react-native run-ios and it started working again.
I have the same problem, here is the full log:
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.
Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.
Running "main" with {"rootTag":1,"initialProps":{}}
Invariant Violation: "main" has not been registered. This can happen if:
AppRegistry.registerComponent wasn't called.AppRegistry.registerComponent wasn't called.@ishmaell same result.
@karol-bisztyga I already did that, I couldn't see any specific issue on Xcode console
@Johan-dutoit I kill the node js task, also removed node modules, clear the caches, clean build folder from Xcode.. result is same
Same issue
Same here
Please take a look at any errors that appear just prior to the AppRegistry complaint. In my case, I'd installed a new module/plugin using NPM, yet didn't link the module or run "pod install" to get it registered. After doing so, I was able to run the app.
example:
react-native link @react-native-community/geolocation
cd to ios and run:
pod install
Finally I was able to resolved this issue by replacing extends TextInput with extends React.Component in a custom TextInput component. I was experiencing this issue after upgrading the react native version from 0.61.2 to 0.63.3.
Example:
Before Fix:
import React from 'react';
import {TextInput} from 'react-native';
class CustomTextInput extends TextInput{
render(){
/code/
}
}
After Fix:(Working code):
import React from 'react';
import {TextInput} from 'react-native';
class CustomTextInput extends React.Component{
render(){
/code/
}
}
+1, occurring for me on version 2.0.0-rc.0 on an iOS Simulator. Basically was wanting to try out reanimated2 in a project that was using reanimated1 but as soon as I try to use a shared value (useSharedValue()) I get the following error:
[Sat Nov 28 2020 21:37:27.599] ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.
[Sat Nov 28 2020 21:37:27.600] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Sat Nov 28 2020 21:37:28.742] ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
I have tried pretty much everything I can think of... npx react-native --reset-cache, watchman watch-del-all
, Clean iOS project, delete Pods/, delete derived data.
My setup:
System:
OS: macOS 10.15.7
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 524.05 MB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
Yarn: 1.22.4 - ~/.nvm/versions/node/v12.16.3/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v12.16.3/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.0 - /Users/brent.kelly/.rvm/gems/ruby-2.6.3/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK:
API Levels: 23, 26, 27, 28, 29, 30
Build Tools: 28.0.2, 28.0.3, 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.0, 30.0.2
System Images: android-21 | Intel x86 Atom_64, android-22 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-24 | ARM 64 v8a, android-25 | Intel x86 Atom_64, android-25 | Google APIs ARM 64 v8a, android-26 | Intel x86 Atom_64, android-27 | Intel x86 Atom_64, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google X86_ARM Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6858069
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_201 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
So I've managed to work out what was causing my issue above ^^. I was trying to use reanimated2 in a brownfield app where the RCTBridge gets initialized outside of the AppDelete (so AppDelegate does not implement the RCTBridgeDelegate protocol). In this circumstance the jsExecutorFactoryForBridge function from UIResponder+Reanimated.mm is never called, and therefore global.__reanimatedModuleProxy is never setup for the JS layer to use.
I've repro'd the issue by forking the Reanimated2Playground repro and changing the AppDelegate to use a RCTBridge that's initialized from a separate class here.
This works...
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, RCTBridgeDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
let bridge = RCTBridge(delegate: self, launchOptions: nil)
let rootView = RCTRootView(bridge: bridge!,
moduleName: "Reanimated2Playground",
initialProperties: nil)
self.window = UIWindow(frame: UIScreen.main.bounds);
let rootViewController = UIViewController();
rootViewController.view = rootView;
self.window!.rootViewController = rootViewController;
self.window?.makeKeyAndVisible();
return true
}
func sourceURL(for bridge: RCTBridge!) -> URL! {
return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index", fallbackResource: nil)
}
}
But this doesn't work...
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
let rootView = RCTRootView(bridge: BridgeManager.sharedInstance.bridge,
moduleName: "Reanimated2Playground",
initialProperties: nil)
self.window = UIWindow(frame: UIScreen.main.bounds);
let rootViewController = UIViewController();
rootViewController.view = rootView;
self.window!.rootViewController = rootViewController;
self.window?.makeKeyAndVisible();
return true
}
}
// Bridge is initialized in a class that doesn't extend from UIResponder so some of
// the Reanimated init code from UIResponder+Reanimated.mm doesn't fire.
class BridgeManager: NSObject, RCTBridgeDelegate {
lazy var bridge: RCTBridge = {
return RCTBridge(delegate: self, launchOptions: nil)
}()
static let sharedInstance = BridgeManager()
private override init() {
super.init()
}
func sourceURL(for bridge: RCTBridge!) -> URL! {
return RCTBundleURLProvider.sharedSettings()?.jsBundleURL(forBundleRoot: "index", fallbackResource: nil)
}
}
So it appears there is an issue with Reanimated2 and brownfield React Native apps (or apps that don't follow the traditional template from React Native hello world). Should I raise a separate issue for this? (_Feels quite important for Reanimated2 to work in Brownfield scenarios_)
@mrbrentkelly, sure thing! Please include a link to the repo reproducing this issue if that's not a problem, it'll make our lives easier when debugging & fixing this one.
I also run into this when using reanimated rc1 with react-native-navigation (It used to work in beta 8)
Just ran into this issue this evening. Similar issue using react-native-navigation.
je viens de rencontr茅 ce probeme egalement en executant https://reactnative.dev/docs/navigation de le documentation react-native
Most helpful comment
I also run into this when using reanimated rc1 with
react-native-navigation(It used to work in beta 8)