ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

flutter amap_base_map Android编译报错 'onMethodCall' overrides nothing

2020-07-09 10:05:49  阅读:557  来源: 互联网

标签:map pub onMethodCall base 报错 amap nothing flutter


在使用amap_base_map做地图功能的时候,iOS的没有问题,Android编译时报错,报错内容

e: /Users/chenhao/flutter/.pub-cache/hosted/pub.flutter-io.cn/amap_base_map-0.4.4+4/android/src/main/kotlin/me/yohom/amapbasemap/map/MapHandlers.kt: (237, 1): 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.amapbasemap.MapMethodHandler
e: /Users/chenhao/flutter/.pub-cache/hosted/pub.flutter-io.cn/amap_base_map-0.4.4+4/android/src/main/kotlin/me/yohom/amapbasemap/map/MapHandlers.kt: (243, 5): 'onMethodCall' overrides nothing
                                                                        
FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':amap_base_map:compileReleaseKotlin'.        
> Compilation error. See log for more details                           
                                                                        
* Try:                                                                  
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
                                                                        
* Get more help at https://help.gradle.org                              
                                                                        
BUILD FAILED in 5s  

报错的大致内容是 在

/Users/chenhao/flutter/.pub-cache/hosted/pub.flutter-io.cn/amap_base_map-0.4.4+4/android/src/main/kotlin/me/yohom/amapbasemap/map/MapHandlers.kt: 

这个路径下MapHandlers.kt文件 中(243, 5)这个位置onMethodCall有问题,找到这个位置并定位到onMethodCall 把

 override fun onMethodCall(p0: MethodCall?, p1: MethodChannel.Result?) {
        registrar.activity().startActivity(
                Intent(AMapBaseMapPlugin.registrar.activity(),
                        OfflineMapActivity::class.java)
        )
    }

把 ? 可选项 去掉 在重新编译即可

标签:map,pub,onMethodCall,base,报错,amap,nothing,flutter
来源: https://www.cnblogs.com/qqcc1388/p/13271889.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有