Open raduvarga opened 7 months ago
Same here. Cant run on android.
We have a app running with older builds, I haven't touched react-native in a while so I cannot debug this atm.
Same on iOS latest RN
I am getting a similar error, but only when running tests with jest:
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'ReactNativeKCKeepAwake' could not be found. Verify that a module by this name is registered in the native binary.
Version 1.2.3
Any ideas?
Hey @owlfrancesco, I also encounter the same.
I solved it by adding a mock for TurboModuleRegistry.getEnforcing(...)
, as per this stackoverflow thread
jest.mock('react-native/Libraries/TurboModule/TurboModuleRegistry', () => {
const turboModuleRegistry = jest.requireActual('react-native/Libraries/TurboModule/TurboModuleRegistry');
return {
...turboModuleRegistry,
getEnforcing: (name) => {
// List of TurboModules libraries to mock.
const modulesToMock = ['ReactNativeKCKeepAwake'];
if (modulesToMock.includes(name)) {
return null;
}
return turboModuleRegistry.getEnforcing(name);
},
};
});
I am getting the above error after installing the library. On iOS, I figured I have to install the pods and then the error went away. Are there further Android installation instructions?