Skip to content

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

@dyelax

Description

@dyelax

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);
    });
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions