4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Flutterのビルドが異常に遅くなる

Posted at

概要

Dartパッケージのcloud_firestoreを入れたことで、iosのビルドに異常に時間がかかるようになってしまった。(というか、一生ビルドが終わらない、、)

解決方法

Firestore iOS SDKを使うことで、ビルドの時間短縮ができる。

  1. ios/PodFileに以下を追記する
target 'Runner' do
  use_frameworks!
  use_modular_headers!
  
  # この1行をを追加する(最新バージョン)
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '9.0.0' 

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
  1. flutter clearを実行
  2. pubspec.yamlでpub getを実行
  3. ビルドを開始する

追記

自分の環境だとFirestore iOS SDKのtagが9.0.0だと失敗してしまった。

Launching lib/main.dart on iPhone 12 Pro in debug mode...
Running pod install...
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      M FirebaseFirestore
      - Flutter
      - cloud_firestore
      - firebase_auth
      - firebase_core
      - firebase_storage
      - image_picker_ios

    Fetching external sources
    -> Pre-downloading: `FirebaseFirestore` from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `9.0.0`
      > Copying FirebaseFirestore from `/Users/miyamotonanako/Library/Caches/CocoaPods/Pods/External/FirebaseFirestore/d32736d2fefbda490b7c3d56f3ac4f2f` to `Pods/FirebaseFirestore`
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `cloud_firestore` from `.symlinks/plugins/cloud_firestore/ios`
    cloud_firestore: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_auth` from `.symlinks/plugins/firebase_auth/ios`
    firebase_auth: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_storage` from `.symlinks/plugins/firebase_storage/ios`
    firebase_storage: Using Firebase SDK version '8.15.0' defined in 'firebase_core'
    -> Fetching podspec for `image_picker_ios` from `.symlinks/plugins/image_picker_ios/ios`

    Resolving dependencies of `Podfile`
      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/9.0.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
      CDN: trunk Relative path: Specs/0/3/5/Firebase/8.15.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update
    [!] CocoaPods could not find compatible versions for pod "FirebaseFirestore":
      In Podfile:
        FirebaseFirestore (from `https://github.com/invertase/firestore-ios-sdk-frameworks.git`, tag `9.0.0`)

        cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) was resolved to 3.1.15, which depends on
          Firebase/Firestore (= 8.15.0) was resolved to 8.15.0, which depends on
            FirebaseFirestore (~> 8.15.0)

    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `tap'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:257:in `process_topmost_state'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in `resolve'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `load'
    /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in `<main>'

Error running pod install
Error launching application on iPhone 12 Pro.

tagを8.15.0に変更したら無事ビルド完了!

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?