Flutterででてくる fatal error: 'location/LocationPlugin.h' file not found バグ
現状
FlutterでLyokone/locationやshared_preferences とか使おうとした時に、Xcodeが以下のようなエラーを吐くことがある
GeneratedPluginRegistrant.m:6:9: fatal error: 'location/LocationPlugin.h' file not found #import <location/LocationPlugin.h>
GeneratedPluginRegistrant.m:6:9: fatal error: 'shared_preferences/SharedPreferencesPlugin.h' file not found #import <shared_preferences/SharedPreferencesPlugin.h>
悲しい
対応
強引にコードを突っ込んだら動いた。
1
Headers/location
をつくる
mkdir ios/Pods/Headers/location/
2 codeをコピーする
cp ~/.pub-cache/hosted/pub.dartlang.org/location-1.1.7/ios/Classes/* ios/Pods/Headers/location/
3 include pathを変更する Xcodeを開き、 Build settings -> Search Paths -> Header Search Paths
"${PODS_ROOT}/Headers"
をHeader Search Paths
に入れる4 動かす