E | ReactNativeJS ▶︎ TypeError: null is not an object (evaluating 'l.start')

时间:2021-05-21 13:02:38

标签: react-native react-native-android

Estou tendo esse problema ao tentar rodar o app react native no meu celular via depuração usbenter image description here

Abaixo o index da minha aplicação, funciona no pc de outro dev mas no meu da esse erro e eu não imagino a solução pra isso。

import {AppRegistry, LogBox} from 'react-native';
import Routes from './src/routes';
import {name as appName} from './app.json';
import {saveToken} from './src/services/notifications';
import {getUser} from './src/utils';
import {Vibration, AppState} from 'react-native';
import messaging from '@react-native-firebase/messaging';

LogBox.ignoreLogs(['Warning: ...']);
LogBox.ignoreAllLogs();

AppState.addEventListener('change', async () => {
  try {
    Vibration.cancel();
  } catch (e) {}
});

(async function requestUserNotificationPermission() {
  try {
    await messaging().requestPermission();
  } catch (e) {
    console.log(e);
  }
})();

messaging().onTokenRefresh(async (token) => {
  if (!token) {
    return;
  }
  const user = await getUser();

  await saveToken(user.phoneNumber, token);
});

messaging().setBackgroundMessageHandler(async () => {
  console.log('setBackgroundMessageHandler');
  const pattern = [500, 500];
  Vibration.vibrate(pattern, true);
});

AppRegistry.registerComponent(appName, () => Routes);

0 个答案:

没有答案