react-native-system-setting icon indicating copy to clipboard operation
react-native-system-setting copied to clipboard

Invariant Violations on iOS ("`new NativeEventEmitter()` requires a non-null argument", and "Module AppRegistry is not a registered callable module")

Open dyelax opened this issue 3 years ago • 2 comments

I'm trying to use this package on iOS. If I just import SystemSetting from "react-native-system-setting" without using it, it runs fine, but when calling any of the SystemSetting methods, I get the following breaking errors:

 ERROR  Invariant Violation: `new NativeEventEmitter()` requires a non-null argument.
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. 
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

I've tried SystemSetting.getVolume(), SystemSetting.setVolume() and SystemSetting.getBrightness() and all fail.

I've tried applying the fix from #140 but it doesn't resolve the errors.

=============

react-native-system-setting Version: 1.7.6 iOS Version: 14.8.1

Installation Steps:

yarn add react-native-system-setting
react-native link react-native-system-setting

Code:

import SystemSetting from "react-native-system-setting";

class SystemSettingExample extends Component {
  async componentDidMount() {
    this.volumeListener = SystemSetting.addVolumeListener(data => {
      console.log("DATA", data);
    });
  }
}

dyelax avatar Mar 06 '22 20:03 dyelax

Same issue here

geroale avatar Mar 09 '22 12:03 geroale

Most likely a duplicate of https://github.com/c19354837/react-native-system-setting/issues/137 but for the iOS side.

GabLeRoux avatar Sep 19 '23 18:09 GabLeRoux