transistorsoft / react-native-background-fetch

Periodic callbacks in the background for both IOS and Android
MIT License
1.43k stars 191 forks source link

Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes #478

Closed ArtsiomAstrouski closed 4 months ago

ArtsiomAstrouski commented 4 months ago
Снимок экрана 2023-12-23 в 23 37 30 Снимок экрана 2023-12-23 в 23 37 44

Your Environment

"react": "18.2.0", "react-native": "0.71.13",

Expected Behavior

Launch of the project

Actual Behavior

erorr

Steps to Reproduce

  1. install npm i react-native-background-fetch
  2. added logic
  3. error
Malhar99 commented 4 months ago

Same issue, Did you get any solution?

ArtsiomAstrouski commented 4 months ago

@Malhar99 I did a complete reinstallation of all dependencies with clearing the cache and it helped

Malhar99 commented 4 months ago

@ArtsiomAstrouski In my case there was some issue with the pod install so I reinstalled it and it works for me now

demoric102 commented 2 months ago

I am experiencing same issue. With the same configuration. Can you please describe what the resolution is?

Malhar99 commented 2 months ago

@demoric102

🚨 Issue Resolution Guide: Clearing Pod Dependencies and Reinstalling

Steps to Resolve:

  1. Open Terminal:

    • Open the Terminal on your local machine.
  2. Navigate to Your Project Directory:

    • Use the cd command to navigate to your project directory.
      cd /path/to/your/project
  3. Remove Existing Podfile.lock and Pods Directory:

    • Delete the current Podfile.lock and Pods directory to start with a clean slate.
      rm Podfile.lock
      rm -rf Pods
  4. Remove CocoaPods Cache:

    • Clear the CocoaPods cache to avoid any potential caching issues.
      pod cache clean --all
  5. Install CocoaPods:

    • If you don't have CocoaPods installed, install it using the following command:
      sudo gem install cocoapods
  6. Install Pods:

    • Run the following command to install the dependencies specified in your Podfile:
      pod install
  7. Open the Workspace:

    • If you're not already using the .xcworkspace file, open it in Xcode:
      open YourProject.xcworkspace
  8. Clean Build:

    • Clean and build your project to ensure a fresh compilation:
      • In Xcode, go to Product > Clean Build Folder.
      • Then, build the project (Command + B).
  9. Run Your Project:

    • Run your project to check if the issue is resolved.
  10. Verify the Issue Status:

    • Confirm whether the issue still persists. If it does, please provide additional details or error messages for further assistance.

Notes:

This process should help in clearing existing dependencies and reinstalling them. If the issue persists, provide more details for a more targeted resolution.