[Flutter] 잘 되던 빌드가 갑자기 "CocoaPods not installed. Skipping pod install"를 일으킬 때.

Hans Park·2022년 1월 24일
1

Flutter

목록 보기
10/14

😢 어...?

배터리 충전량을 신경쓰고 살지 않다가, 맥 배터리가 다나가져 그 동안 켜놨던 크롬 30개 탭, ios simulator, Android Studio, Slack 등이 전부 재실행되었다.

많이 아파하는 CPU에게 잠시 미안함을 느끼고, 다시 Android Studio에서 Run을 눌렀다.



Warning: CocoaPods is installed but broken. Skipping pod install.
  You appear to have CocoaPods installed but it is not working.
  This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
  This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
To re-install:
  sudo gem install cocoapods

































CocoaPods가 무엇이오?

CocoaPods 공식사이트의 설명에 의하면

"CocoaPods는 Swift 및 Objective-C 코코아 프로젝트의 종속성 관리자입니다.
28,000 개가 넘는 라이브러리를 가지고 있으며, 170 만 개가 넘는 응용 프로그램(앱)에서 사용되고 있습니다.

라고 한다.
https://cocoapods.org/

Flutter가 android와 ios에서 전부 빌드가 되어야 하다보니, xcode를 통해 사용하는 것 같다.

해결 방안

1. CocoaPods가 애초에 설치되어있지 않을 경우

flutter doctor를 실행하여 cocoapods가 설치되어있는지 확인해본다.

설치되어있지 않을 경우, flutter doctor 내 해결방안을 참고하여 설치한다.

2. 설치된 CocoaPods가 많이 아픈 경우

어떤 이유로 인해 설치된 CocoaPods가 꼬이거나 문제가 생겼을 수 있다.
sudo gem uninstall cocoapods를 통해 삭제하고,
sudo gem install cocoapods하여 다시 설치해보자.

3. Android Studio가 문제일 경우

생각보다 Android Studio 또한 많이 고장날 때가 있다.

install된 라이브러리를 찾지 못한다거나, dart언어 자체를 인식하지 못하는 경우도 있었다.

Android Studio Menu -> File -> Invalidate Caches / Restart...
를 통해 Android Studio를 재시작하면 대부분 해결된다.

출처

profile
장안동 개발새발

1개의 댓글

comment-user-thumbnail
2022년 1월 30일

앱 간의 의존성 문제를 잘 해결하셨군요. 좋은 팁 감사합니다.

답글 달기