LoginSignup
15
9

More than 3 years have passed since last update.

FlutterでGoogleDataTransportにエラーが出た時の対処

Posted at

はじめに

Flutterで開発をios/Android開発している者です。
先日、Flutter run
ビルド時にこんなエラーが出ました。

error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORDataFuture.h'

今回はこのエラーの対処法についてお話します。

開発環境

MacOS Catalina -v10.15.5

エラー

Flutter run
実行時のエラーログ

Launching lib/main.dart on iPhone 8 in debug mode...
Running Xcode build...
Xcode build done.                                           24.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORDataFuture.h' [-Werror,-Wincomplete-umbrella]
    #import "Headers/GoogleDataTransport-umbrella.h"
    ^
    <module-includes>:1:1: error: umbrella header for module 'GoogleDataTransport' does not include header 'GDTCORStoredEvent.h' [-Werror,-Wincomplete-umbrella]
    2 errors generated.
    In file included from app/ios/Pods/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport/GDTCCTLibrary/GDTCOREvent+NetworkConnectionInfo.m:17:
    app/ios/Pods/GoogleDataTransportCCTSupport/GoogleDataTransportCCTSupport/GDTCCTLibrary/Private/GDTCOREvent+NetworkConnectionInfo.h:17:9: fatal error: c<img width="1440" alt="スクリーンショット 2020-06-06 13.42.55.png" src="https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/387365/81158a4b-2a3a-d0ea-7a13-f30019f0eff1.png">
ould not build module 'GoogleDataTransport'
    #import <GoogleDataTransport/GDTCOREvent.h>
     ~~~~~~~^
    3 errors generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
    warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settipod update Firebase/Firestore
ngs are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 8.

GoogleDataTransportが関連していたので調べてみると
Githubのissueが参考になった
どうやら Firebase's SDK/podが影響しているみたい。

A5B4F8D0-8C71-4B30-B1D9-A09FFBA65F97_1_105_c.jpeg

エラ-ログと比べてみると #import <GoogleDataTransport/GDTCOREvent.h>の部分が追記されているのがわかる。(2019/9/27)

つまり、古いモジュールが更新されていないためビルドに失敗した模様

解決策

まずはFlutterのiosディレクトリに移動しPodsを削除する
(Pods はインストールしたパッケージが入っているだけ。)
$ rm -rf Pods

次に、溜まっていたビルドキャッシュを削除する。
これをしないとせっかく消去したのに同じやつを参照しかねない
$ flutter clean

そして再び実行
$ flutter run

この時、pod installが実行されPodsが再構成される。
そして無事に生還

まとめ

Pod関連のエラーでした。
アプリ自体はgit cloneでローカルに持ってきたんですが、おそらくリモートのファイルにPodfileの更新をしていなかったのが原因だと思います。
$ rm -rf Podsこういうパワー系のコマンドはできれば打ちたくない(怖い)

15
9
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
15
9