2
1

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 3 years have passed since last update.

flutter_blueがiOSでヘッダーファイルを見つけられなくてbuildできない問題

Last updated at Posted at 2020-02-05

エラーメッセージ

fatal error: could not build module 'flutter_blue'

あるいは

'FlutterBluePlugin.h' file not found

というエラーが出てビルドできない。

環境

  • Flutter 1.14.6
  • flutter_blue 0.6.3+1
  • cocoapods 1.8.4
  • Xcode 11.3.1

対策

Flutter Pluginsにあるflutter_blue-0.6.3+1/ios/flutter_blue.podspecファイルの一部を下記のように編集する
(Android Studioで作業しているとプロジェクト外のファイルを触ることで警告が出るかもです。)

  ~ 略 ~
  
  s.subspec 'Protos' do |ss|
    ss.source_files = 'gen/**/*.pbobjc.{h,m}'
    # ss.header_mappings_dir = '.'  <- コメントアウト
    ss.requires_arc = false
    ss.dependency 'Protobuf'
  end
  
  ~ 略 ~

iOSのプロジェクトディレクトリにあるPodsやPodfile.lockを削除し、インストールをやり直す。

rm -fr Pods Podfile.lock
pod install

参考

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?