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

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


I’m making a cellular software for Android and ios utilizing react-native
this app exhibits clients’ product
and might create accounts utilizing Fb and Google, I take advantage of Firebase to create accounts and save information
when operating the appliance in an Android emulator works with no error
however when operating utilizing the simulator for ios exhibits me this error:-

ERROR Invariant Violation: new NativeEventEmitter() requires a
non-null argument., js engine: hermes LOG Working “ShoofMangment”
with {“rootTag”:1,”initialProps”:{“concurrentRoot”:false}} ERROR
Invariant Violation: “ShoofMangment” has not been registered. This may
occur if:

  • Metro (the native dev server) is run from the fallacious folder. Examine if Metro is operating, cease it and restart it within the present challenge.
  • A module didn’t load on account of an error and AppRegistry.registerComponent wasn’t known as., js engine: hermes data
    Stopping server

I utilizing to npx react-native begin --reset-cache
and utilizing to pod set up
and I utilizing this library in my challenge

 "@firebase/app": "^0.10.15",
"@firebase/element": "^0.6.10",
"@firebase/logger": "^0.4.3",
"@firebase/util": "^1.10.1",
"@invertase/react-native-apple-authentication": "^2.4.0",
"@react-native-async-storage/async-storage": "^2.0.0",
"@react-native-community/cli": "^15.0.0",
"@react-native-community/datetimepicker": "^8.2.0",
"@react-native-firebase/app": "^20.5.0",
"@react-native-firebase/auth": "^20.5.0",
"@react-native-firebase/database": "^20.5.0",
"@react-native-firebase/firestore": "^20.5.0",
"@react-native-firebase/storage": "^20.5.0",
"@react-native-google-signin/google-signin": "newest",
"@react-navigation/native": "^6.1.18",
"@react-navigation/stack": "^6.4.1",
"firebase": "9.6.1",
"i18next": "^23.15.1",
"react": "18.3.1",
"react-i18next": "^15.0.1",
"react-native": "^0.75.3",
"react-native-animatable": "^1.4.0",
"react-native-collapsible": "^1.6.2",
"react-native-elements": "^3.4.3",
"react-native-fbsdk-next": "^13.0.0",
"react-native-geolocation-service": "^5.3.1",
"react-native-gesture-handler": "^2.19.0",
"react-native-image-picker": "^7.1.2",
"react-native-linear-gradient": "^2.8.3",
"react-native-localize": "^3.2.1",
"react-native-maps": "^1.15.6",
"react-native-permissions": "^4.1.5",
"react-native-qrcode-scanner": "^1.5.5",
"react-native-safe-area-context": "^4.11.0",
"react-native-screens": "^3.34.0",
"react-native-share": "^11.0.4",
"react-native-swiper": "^1.6.0",
"react-native-vector-icons": "^10.2.0",
"react-native-video": "^6.6.4"

enter picture description right here

and that is my App.js file code

import React, {useEffect, useState} from 'react';
import {NavigationContainer} from '@react-navigation/native';
import AppNavigator from './src/navigation/AppNavigator';
import './belongings/i18n';
import {Settings} from 'react-native-fbsdk-next';
import auth from '@react-native-firebase/auth';
import firebase from '@react-native-firebase/app';

import AsyncStorage from '@react-native-async-storage/async-storage';
import {ActivityIndicator, View} from 'react-native';
import {BottomNavigationProvider} from './src/navigation/BottomNavigationContext'; // 
استيراد المزود

export default perform App() {
  const [isLoading, setIsLoading] = useState(true);
  const [initialRoute, setInitialRoute] = useState('LoginScreen'); // تحديد الشاشة 
الافتراضية

 useEffect(() => {
// تهيئة Fb SDK
Settings.initializeSDK();

// التحقق من حالة تسجيل الدخول باستخدام AsyncStorage و Firebase Auth
const checkLoginStatus = async () => {
  attempt {
    const userInfo = await AsyncStorage.getItem('person');
    console.log('userInfo information from AsyncStorage:', userInfo);

    if (userInfo) {
      console.log('Navigating to DashboardScreen');

      // إذا كان userInfo موجودًا في AsyncStorage، توجيه المستخدم إلى Dashboard
      setInitialRoute('DashboardScreen');
      setIsLoading(false);
    } else {
      console.log('Firebase Consumer Logged in:');

      // استخدام Firebase Auth للتحقق من حالة المستخدم
      auth().onAuthStateChanged(person => {
        if (person) {
          // المستخدم مسجل دخول
          setInitialRoute('DashboardScreen');
        } else {
          console.log('No person logged in, navigating to SplashScreen');

          // المستخدم غير مسجل دخول
          setInitialRoute('SplashScreen');
        }
        setIsLoading(false);
      });
    }
  } catch (error) {
    console.error('Error checking login standing:', error);
    setIsLoading(false);
    setInitialRoute('SplashScreen');
  }
};
checkLoginStatus();
  }, []);



 if (isLoading) {
    return (
      
        
      
    );
  }
  return (
    
      {/* تغليف المزود هنا */}
      
        
      
    
  );
}

Leave a Reply

Your email address will not be published. Required fields are marked *