yaml文件引入:
在Flutter引入这个文件之后不管上Android还是Ios,都会出现编译失败的错误,经过逛 博客圆,CSDN,和全球最大同性交友网站GitHub,最终得出了答案。所以在此写个解决方案的记录。
android的解决方案相对来说很轻易的就能在网上找到,但IOS相对难找一些,所以我两个都写吧。
Androi的解决方案:
安卓需要改两处源码
第一处:找到如下图所示代码区域,将标记的两个 ? 号删除
(修改前)

(修改后)

这里如果不改就会出现如下报错信息
Object 'OpenOfflineManager' 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.amapbase.MapMethodHandler
第二处:
同样,将其删除
(修改前)
(修改后)

这里不改会出现如下错误信息
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.amapbase.SearchMethodHandler
至此,安卓端的问题就可以解决了
IOS端
IOS端的解决需要用到XCode,如果没有就先下一个吧Open iOS mocdule in XCode
随便打开一个ios下的文件,点击右上角的

点击后回进到这个界面,然后按照图中顺序 选择 Runner---->Build Settings ------>All--------> 右上角的Search(也就是输入框)------->输入Compile Sources As

然后就可以把XCode关掉,在AS里运行项目到IOS平台上了 |