본문 바로가기

Programming/flutter

[flutter] ios firebase 연동 문제

 

기본 flutter 페이지에 firebase 연동만 시켰더니 다음과 같은 문제가 발생했다.

Running "flutter pub get" in firestore...
Launching lib/main.dart on iPhone 12 Pro in debug mode...
lib/main.dart:1
CocoaPods' output:
↳
      Preparing
    Analyzing dependencies
    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    cloud_firestore: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "cloud_firestore":
      In Podfile:
        cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)
    Specs satisfying the `cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)` dependency were found, but they required a higher minimum deployment target.
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/bin/pod:23:in `load'
    /usr/local/Cellar/cocoapods/1.10.1_1/libexec/bin/pod:23:in `<main>'
Error output from CocoaPods:
↳
    [!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone 12 Pro.
Exited (sigterm)

 

이를 해결하기 위해서 터미널 상 ios폴더에 들어가서

$pod update

를 진행하였지만 다른 오류가 발생


-----------

❯ pod update
Update all pods
Updating local specs repositories
Analyzing dependencies
cloud_firestore: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
firebase_core: Using Firebase SDK version '7.3.0' defined in 'firebase_core'
[!] CocoaPods could not find compatible versions for pod "cloud_firestore":
  In Podfile:
    cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)

Specs satisfying the `cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`)` dependency were found, but they required a higher minimum deployment target.

[!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

 

오류 코드가 나온 아래의 항목이다. 

https://guides.cocoapods.org/syntax/podfile.html#platform%22%EC%9D%84

 

CocoaPods Guides

CocoaPods is fully open-sourced, so it depends on community contributions to get better. If you're looking to start working on CocoaPods, this is the place to start.

guides.cocoapods.org

 

즉 오류 코드 (Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.)

이것이 이야기 하는 것은 플랫폼이 지정되지 않아서 Runner에서 자동적으로 ios version 9.0을 지정하려고 하는데 무언가 오류가 있다는 것이다. 

 

ios/Podfile에 들어가 보니 2번째 line에서 

2번째 라인이 주석 처리가 되어 있다.

2번째 라인이 주석처리가 되어 있어서 계속 build를 못하고 있었던 것이다. 이를 해지시켜주자

 

그러고 Debug를 시켰는데도 동일한 문제 발생

 

ios version이 문제라고 생각이 들어서 simulator에서 돌아가고 있는 ios version을 확인하여 맞는 것을 입력 시켰다.

 

version 확인

 

저렇게 맞추어 주고 Debug를 돌렸다니 470초 8분이 조금 안되게 걸렸고 build가 완료 되었다.

 

 

'Programming > flutter' 카테고리의 다른 글

[flutter] state management - GetX  (0) 2021.07.07
[flutter] State mangement : Provider  (0) 2021.07.01
[flutter] ios firebase 연동  (0) 2021.06.29
[Github] VScode를 통해서 github에 올리기  (0) 2021.06.29
[Flutter] Firestore  (0) 2021.06.29