
App.js 코드스니펫 복붙하고 실행했더니 에러가 납니다.

작성한 코드 및 에러 메세지
import React, { useEffect } from 'react';
//이제 모든 페이지 컴포넌트들이 끼워져있는 책갈피를 메인에 둘예정이므로
//컴포넌트를 더이상 불러오지 않아도 됩니다.
// import MainPage from './pages/MainPage';
// import DetailPage from './pages/DetailPage';
import { StatusBar } from 'expo-status-bar';
//메인에 세팅할 네비게이션 도구들을 가져옵니다.
import {NavigationContainer} from '@react-navigation/native';
import StackNavigator from './navigation/StackNavigator'
import mobileAds from 'react-native-google-mobile-ads';
export default function App() {
console.disableYellowBox = true;
useEffect(()=>{
//구글 애드몹은 실제 빌드된 앱에서만 가능하기 때문에! 조건부 처리!
if(!__DEV__){
mobileAds()
.initialize()
.then(adapterStatuses => {
// Initialization complete!
});
}
},[])
return (
<NavigationContainer>
<StatusBar style="black" />
<StackNavigator/>
</NavigationContainer>);
}
-----------------------------------------------------------------------------------------------------------------------------------------------
Invariant Violation: Your JavaScript code tried to access a native module that doesn't exist.
If you're trying to use a module that is not supported in Expo Go, you need to create a development build of your app. See https://docs.expo.dev/development/introduction/ for more info.
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:null in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:null in handleError
at node_modules\expo\build\errors\ExpoErrorManager.js:null in errorHandler
at node_modules\expo\build\errors\ExpoErrorManager.js:null in <anonymous>
at node_modules\@react-native\polyfills\error-guard.js:null in ErrorUtils.reportFatalError
at node_modules\metro-runtime\src\polyfills\require.js:null in guardedLoadModule
at node_modules\metro-runtime\src\polyfills\require.js:null in runUpdatedModule
at node_modules\metro-runtime\src\polyfills\require.js:null in metroHotUpdateModule
at node_modules\metro-runtime\src\polyfills\require.js:null in define
at node_modules\metro-runtime\src\modules\HMRClient.js:null in inject
at node_modules\metro-runtime\src\modules\HMRClient.js:null in injectUpdate
at node_modules\metro-runtime\src\modules\HMRClient.js:null in on$argument_1
at node_modules\metro-runtime\src\modules\vendor\eventemitter3.js:null in emit
at node_modules\metro-runtime\src\modules\HMRClient.js:null in _ws.onmessage
at node_modules\event-target-shim\dist\event-target-shim.js:null in EventTarget.prototype.dispatchEvent
at node_modules\react-native\Libraries\WebSocket\WebSocket.js:null in _eventEmitter.addListener$argument_1
at node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:null in emit
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:null in callFunctionReturnFlushedQueue
