关于flutter使用高德地图search api

£可爱£侵袭症+ 提交于 2019-11-28 17:38:01

pub搜了下amap_base_flutter属于评分比较高的了

参考https://github.com/flutter/flutter/pull/34369

编译的时候报错

e: C:\flutter\.pub-cache\hosted\pub.flutter-io.cn\amap_base_search-0.4.1\android\src\main\kotlin\me\yohom\amapbasesearch\search\SearchHandlers.kt: (326, 1): Object 'DistanceSearchHandler' is not abstract and does not implement abstract member @UiThread public abstract fun onMethodCall(@NonNull p0: MethodCall, @NonNull p1: MethodChannel.Result): Unit defined in me.yohom.amapbasesearch.SearchMethodHandler
e: C:\flutter\.pub-cache\hosted\pub.flutter-io.cn\amap_base_search-0.4.1\android\src\main\kotlin\me\yohom\amapbasesearch\search\SearchHandlers.kt: (327, 5): 'onMethodCall' overrides nothing

插件的源码有问题需要改下

amap_base_flutter-master\search\android\src\main\kotlin\me\yohom\amapbasesearch\search\SearchHandlers.kt line 327

object DistanceSearchHandler : SearchMethodHandler {
    override fun onMethodCall(call: MethodCall, result: MethodChannel.Result?) {//去掉问号

改完后编译通过安装后闪退,查了下应该是32位64位的问题,--target-platform参数已经弃用了 unused flag `--target-platform` from `flutter run`直接改配置文件C:\flutter\packages\flutter_tools\lib\src\android\gradle.dart line 461

    command.add('-Ptarget-platform=android-arm');
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!