흰오목눈이야 개발하자

Flutter iOS 세팅 에러 CocoaPods not installed. 본문

Flutter

Flutter iOS 세팅 에러 CocoaPods not installed.

흰오목눈이 2023. 1. 25. 19:19

flutter doctor를 실행하고 iOS와 관련된 부분에서 문제가 있었다.

[!] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13E113
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

 

문제


위 에러는 CocoaPods 응용 프로그램이 설치되지 않았기 때문에 발생하는 오류다.

 

 

해결


 

- 전제 : Mac 사용, HomeBrew가 설치되어 있음

 

1. 터미널에 아래 명령어를 입력한다.

brew install cocoapods

- 중간에 brew 업데이트가 있다면 끝나고 나서 아래와 같은 문구가 나온다.

To install cocoapods, run:
  brew install --cask cocoapods

터미널에 아래 명령문을 입력해 주면 된다.

brew install --cask cocoapods

CocoaPods 설치 완료

설치했는데도 새로운 에러가 나왔다. 

✗ CocoaPods installed but not working.
        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.
      To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

설치는 되어있지만 작동하지 않는다고 한다. 재설치를 해보자.

brew reinstall --cask cocoapods

다시 flutter doctor를 실행하니 이번에는 cocoapods이 오래되었다고 업데이트하라고 한다.

! CocoaPods 1.5.2 out of date (1.11.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

업데이트 명령문 :

sudo gem install cocoapods

Overwrite the executable? [yN]  가 나오면 y를 입력 후 엔터키를 누른다.

설치가 완료되고 여기까지 끝냈다면 터미널에서 "flutter doctor"를 다시 실행하자.

 

2.  아래와 같이 표시되면 해결되었다. 

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13E113
    • CocoaPods version 1.11.3