Flutter plugin `geolocator-Swift.h` file not found
Since the plugin is written using Swift, the consuming Flutter app should be based on the Swift project template:
$ flutter create -i swift my_app
Adding geolocator:
to the pubspec.yaml
and building my_app
for iOS then works for me using the latest Flutter beta.
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.5 17F77, locale en-US)
you go to Ios/Podfile add the following line:
use_frameworks! # required by Geolocator
Like the following
Prepare symlinks folder. We use symlinks to avoid having Podfile.lock referring to absolute paths on developers' machines.
use_frameworks! # required by Geolocator
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
After this add
config.build_settings['SWIFT_VERSION'] = '4.2'
Like the following:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings['SWIFT_VERSION'] = '4.2' # added this
end
end
end