1
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?

【flutter_error】Lexical or Preprocessor Issue (Xcode): 'grpc/support/port_platform.h' file not found

Last updated at Posted at 2024-06-29

環境

mac, iOS
flutter: 3.19.0
dart: 3.5.0-288.0.dev
firebase_core: 2.24.2
cloud_firestore: 4.16.0

問題

firebaseの公式サイトを参考にfirebase CLIでfirebaseを設定し、cloud_firestore: ^4.16.0を追加し、flutter runしたところ以下のエラーが出ました。

Lexical or Preprocessor Issue (Xcode): 'grpc/support/port_platform.h' file not found

解決

以下のようにしてPodfileに
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.25.0'
を追記したらビルドできました。
tag => '10.25.0'のバージョンはflutterのバージョンによって変わります。エラー文で推奨バージョンが表示されるのでエラーが出た場合は修正して再度実行しましょう。
(こういったpodの変更にはキャッシュの削除のためにpodfile.lockの削除, flutter cleanなどが必要な場合があります。)

target 'Runner' do
  use_frameworks!
  use_modular_headers!
  pod'TensorFlowLiteSelectTfOps','~> 2.6.0'
  pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '10.25.0' #追記
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end
1
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
1
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?