ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Expo eject 하기
    React/React Native 2020. 5. 28. 21:20

    Expo로 개발을 하다가 카카오 로그인 연동을 할 필요가 느껴 eject를 하게 되었다.

    먼저 expo eject를 하여 eject를 한다.

    이후 ios 폴더로 이동하여 pod install 을 해준다.

    그리고 ios 폴더 안에있는 xcworkspace 파일을 실행한다.

    그러고 실행을 하면

     

    Showing All Issues

    Signing for "App Name" requires a development team. Select a development team in the Signing & Capabilities editor.

    위와 같은 에러를 볼 수 있을 것이다. 

     

     

    위의 사진처럼 어플 이름을 클릭하고 Signing & Capabilities 에 들어가 팀이름을 설정 해주면 된다. ios 개발자 계정이 꼭 필요하다.

     

    이후 실행을 하게되면 아래와 같이 에러가 또 나온다.

     

    Showing All Issues

    Command PhaseScriptExecution failed with a nonzero exit code

     

    에러 내용을 자세히 보니 아래와 같았다.

     

    Showing All Issues

    Error: The hashAssetFiles Metro plugin is not configured. You need to add a metro.config.js to your project that configures Metro to use this plugin. See https://github.com/expo/expo/blob/master/packages/expo-updates/README.md#metroconfigjs for an example.

     

    metro.config.js 를 추가해 줘야한다고 한다.

     

    일단 앱 루트 디렉토리에서 expo install expo-updates 명령어를 실행한다.  그 다음 단계로

    expo-asset 을 설정해줘야하지만 나는 registerRootComponent 를 사용해서 할 필요가 없었다. 

    다음으로 앱 루트 디렉토리에 metro.config.js 파일을 추가하고 아래의 내용을 추가해준다.

    이후에 expo update 명령어를 친 다음 업데이트가 끝나면 ios 폴더로 이동하여 pod install 을 다시 해준다. 그러고 나서 다시 빌드 해본 결과 다시 또 똑같은 에러가 떴다. Xcode에 캐시가 남은것 같다. 커맨드 + shift + k를 하여 지워주고 다시 실행을 한다. 하지만 똑같은 에러가 뜬다. 이후에 Xcode 에서 File > workspace setting 에 들어가 build system 을 Legacy build system 으로 바꿔준다.

     

    다 된줄 알았는데 다음 에러가 기다리고 있었다.

    Command /bin/sh failed with exit code 1 다음과 같은 에러를 확인 할 수 있었다.

     

    Run script only when installing을 체크한다.

    이제 핸드폰에서 빌드가 되었다.

    하지만 핸드폰에서 

    You've implemented -[<UIApplicationDelegate> application:performFetchWithCompletionHandler:], but you still need to add "fetch" to the list of your supported UIBackgroundModes in your Info.plist.

     

    You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.

     

    다음과 같은 에러명을 확인 할 수 있었다. info.plist 에 소스코드 보기를 하여 아래의 내용을 추가해주자.

    <key>UIBackgroundModes</key> <array> <string>fetch</string><string>remote-notification</string> </array>

     

    이걸로 끝이아니였다...

    다음에러가 또 기다리고 있었다.

    TypeError: null is not an object (evaluating 'SplashScreen.preventAutoHide' 

     

    AppLoading을 사용해서 다음과 같은 에러가 뜨는 것 이었다. 해당 내용을 지우니깐 그디어 화면이 잘 나온다!

    eject 를 성공적으로 완료하였다... 이제 카카오 로그인 api를 붙여보겠다.

    'React > React Native' 카테고리의 다른 글

    카카오 로그인 연동(expo, React Native)  (0) 2020.06.03
Designed by Tistory.