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');