일모도원(日暮途遠) 개발자

CocoaPods could not find compatible versions for pod 본문

안드로이드 개발/오류수정

CocoaPods could not find compatible versions for pod

달님개발자 2024. 12. 16. 08:24
반응형

[요약]

위 에러로 pod install등이 제대로 안되면 flutter pub upgrade --major-versions를 하고 Podfile의 deployment target을 올려주자.


안드로이드 스튜디오를 플라밍고를 오랫동안 쭉 쓰다가 이번에 레이디 버그(무당벌레)로 올리면서 엄청 고생했었다. 안드로이드는 그레이들을 비롯한 버전 맞춘다고 한참 고생했서 겨우 컴파일 했는데, 아이폰 역시 pod install자체가 안된다.

 

아래 로그를 보면 버전 문제인것은 확실하다. 근데 각 패키지마다 매칭되는 버전을 맞추는게 참 어렵다.

[!] CocoaPods could not find compatible versions for pod "GTMSessionFetcher/Core":
      In Podfile:
        firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) was resolved to 4.17.8, which depends on
          Firebase/Auth (= 10.22.0) was resolved to 10.22.0, which depends on
            FirebaseAuth (~> 10.22.0) was resolved to 10.22.0, which depends on
              GTMSessionFetcher/Core (< 4.0, >= 2.1)

        google_mlkit_text_recognition (from `.symlinks/plugins/google_mlkit_text_recognition/ios`) was resolved to 0.11.0, which depends on
          GoogleMLKit/TextRecognition (~> 4.0.0) was resolved to 4.0.0, which depends on
            MLKitTextRecognition (~> 2.0.0) was resolved to 2.0.0, which depends on
              MLKitVision (~> 5.0) was resolved to 5.0.0, which depends on
                GTMSessionFetcher/Core (< 3.0, >= 1.1)

 

 

위 에러 관련해서 스택플로우나 챗지피티에게 물어봐도  Podfile.lock을 지우고 pod install을 하나거나 flutter clean등을 하라고 하는데, 나의 경우에는 해결되지 않았다.

 

나는 패키지의 버전들이 많이 낮았었다.  Flutter의 pubspec.yaml을 열어서 일일히 firebase_core, firebase_auth등을 최신버전로 올려주는데 계속 다른 에러가 난다.

 

그래서 다음 명령어를 통해서 한번에 모든 패키지 버전을 확 올리니 CocoaPods could not find compatible versions 에러는 사라졌다.

flutter pub upgrade --major-versions

git:(dalnim*)> flutter pub upgrade --major-versions
Resolving dependencies... (2.0s)
Changed 19 constraints in pubspec.yaml:
  flutter_tts: ^3.8.3 -> ^4.2.0
  firebase_core: ^2.16.0 -> ^3.8.1
  firebase_auth: ^4.10.0 -> ^5.3.4
  ~~~~
  webview_flutter 4.9.0 (4.10.0 available)
  webview_flutter_android 3.16.9 (4.2.0 available)
  win32_registry 1.1.5 (2.0.1 available)
These packages are no longer being depended on:
- cryptography 2.7.0
- speech_to_text_macos 1.1.0
Changed 74 dependencies!
25 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

 

 

대신 아래 처럼 deplyment target 버전을 올리라고 나온다.

Error: The plugin "google_mlkit_commons" requires a higher minimum iOS deployment version than your application is targeting.
To build, increase your application's deployment target to at least 15.5.0 as described at https://flutter.dev/to/ios-deploy

 

Podfile을 열고 버전을 시키는대로 맞춰준다.

platform :ios, '15.5'

 

이제 다시 flutter run –-flavor helpee -t lib/main.dart 을 하니 pod install은 끝나고 열심히 build중이다.

 

Podfile만 버전을 고쳐도 컴파일이 되는데, XCode에서도 deplyment target 버전을 같이 맞춰주자.

반응형