• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

안드로이드 변수 오류

22.03.06 01:40 작성 조회수 695

1

1. github 주소: https://github.com/Gophycal/Inflearn

2. 오류사항

ReferenceError: Can't find variable: IDBIndex

- ... 9 more stack frames from framework internals

 

Invariant Violation: "main" has not been registered. This can happen if:

* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.

* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException

at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException

at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError

at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError

3. package.json

{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/native": "^6.0.6",
"@react-navigation/stack": "^6.0.11",
"expo": "^43.0.0",
"expo-image-picker": "~11.0.3",
"expo-status-bar": "~1.1.0",
"firebase": "^9.6.1",
"moment": "^2.29.1",
"prop-types": "^15.7.2",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-gesture-handler": "~1.10.2",
"react-native-gifted-chat": "^0.16.3",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-reanimated": "~2.2.0",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.8.0",
"react-native-web": "0.17.1",
"styled-components": "^5.3.3"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
"private": true
}

4. 문제 발생 지점: 안드로이드 애뮬레이터(Pixel_4)

5. 오류 내용

프로필 화면을 만들던 중 일어난 오류입니다. 구체적으로 navigations의 index, 그리고 firebase.js, screens의 Profile을 수정하여, 'Profile' 스크린에서 사용자의 정보에 따라 이름, 이메일, 사진 등을 보여주는 기능을 추가하는 중에 일어난 오류입니다.

지금 한 5시간째 찾아보고 있는데, 어떻게 해결하는지 잘 모르겠습니다. 추측으로는 노드 모듈에서 버젼이 안 맞는 게 있는 것 같은데, yarn이라든지, npm이라든지 노드 모듈 다 지우고 다시 install 하거나 add 했는데, 오류가 사라지지 않네요.

 

IOS 애뮬레이터(iPhone 13)에서는 오류가 없는데 이상합니다.

답변 1

답변을 작성해보세요.

1

안녕하세요 이승원님, 

  

firebase 9.6.8 버전이 Expo와 뭔가 문제를 일으키는것 같습니다. 

firebase 9.6.7 버전을 이용하면 정상적으로 동작합니다. 

 

추가적으로, react-native-gesture-handler를 expo install 을 이용해서 설치하세요.

그 후, src/App.js 파일에 다음 코드를 추가하세요

import 'react-native-gesture-handler';

참고1: https://reactnavigation.org/docs/stack-navigator 

참고2: https://docs.expo.dev/versions/latest/sdk/gesture-handler/

  

즐거운 하루 되세요

감사합니다. 

이승원님의 프로필

이승원

질문자

2022.03.06

빠르게 해결해주셔서 감사합니다!!!! 기다리고 있었어요!!!