2.flutter-百度定位

2020-09-17  本文已影响0人  程序萌

一、定位Flutter插件集成

pub依赖添加:
      在工程pubspec.yaml文件添加如下代码:
      dependencies:
          flutter_bmflocation: ^1.0.2

二、常见报错1

三、常见报错2

... flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_bmflocation-1.0.2/ios/Classes/BdmapLocationFlutterPlugin.m:3:9: fatal error: 'BMKLocationkit/BMKLocationComponent.h' file not found ...

#import "BMKLocationComponent.h"
3.然后会报找不到BMKLocationComponent 这个文件,这里需要手动部署百度iOS定位SDK,具体步骤可参照iOS定位SDK手动部署说明
也可以自动部署http://lbsyun.baidu.com/index.php?title=ios-locsdk/guide/create-project/cocoapods-create
1.打开ios/Podfile文件,添加

target 'Runner' do
  pod 'BMKLocationKit'
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

2.执行pod install

上一篇 下一篇

猜你喜欢

热点阅读