关于flutter升级后ai_amap-master项目IOS报错的解决方案
关于1.1.0 IOS 提示 type ‘AiAMapLocationPlatformView’ does not conform to protocol ‘AMapGeoFenceManagerDelegate’
日志如下:
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:17:7: error: type 'AiAMapLocationPlatformView' does not conform to protocol 'AMapGeoFenceManagerDelegate'
class AiAMapLocationPlatformView:NSObject,FlutterPlatformView,MAMapViewDelegate, AMapLocationManagerDelegate,AMapGeoFenceManagerDelegate,AMapNaviCompositeManagerDelegate{
^
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:17:7: note: do you want to add protocol stubs?
class AiAMapLocationPlatformView:NSObject,FlutterPlatformView,MAMapViewDelegate, AMapLocationManagerDelegate,AMapGeoFenceManagerDelegate,AMapNaviCompositeManagerDelegate{
^
/Users/zhangzhigang/.pub-cache/hosted/pub.flutter-io.cn/ai_amap-1.1.0/ios/Classes/AiAMapLocationPlatformView.swift:231:46: warning: forced cast from 'String??' to 'String' only unwraps optionals; did you mean to use '!!'?
naviTitle = annotation.title as! String;
~~~~~~~~~~~~~~~~~^~~~~~~~~~
!!
本人原本技术栈为Java 奈何不懂OC/Swift 只好用用笨办法比较差异 解决问题
修改 IOS目录下 Podfile.lock文件与插件版本一致问题解决 特此记录:
PODS:
- ai_amap (0.0.1):
- AMapLocation
- AMapNavi
- Flutter
- AMapFoundation (1.6.3)
- AMapLocation (2.6.5):
- AMapFoundation (~> 1.6.3)
- AMapNavi (7.5.0):
- AMapFoundation (~> 1.6.3)
- connectivity (0.0.1):
- Flutter
- Reachability
- device_info (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_statusbar_manager (0.0.1):
- Flutter
- fluttertoast (0.0.2):
- Flutter
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- path_provider (0.0.1):
- Flutter
- "permission_handler (5.1.0+2)":
- Flutter
- Reachability (3.2)
- shared_preferences (0.0.1):
- Flutter
- sqflite (0.0.2):
- Flutter
- FMDB (>= 2.7.5)
- url_launcher (0.0.1):
- Flutter
DEPENDENCIES:
- ai_amap (from `.symlinks/plugins/ai_amap/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- device_info (from `.symlinks/plugins/device_info/ios`)
- Flutter (from `Flutter`)
- flutter_statusbar_manager (from `.symlinks/plugins/flutter_statusbar_manager/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
SPEC REPOS:
trunk:
- AMapFoundation
- AMapLocation
- AMapNavi
- FMDB
- Reachability
EXTERNAL SOURCES:
ai_amap:
:path: ".symlinks/plugins/ai_amap/ios"
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
device_info:
:path: ".symlinks/plugins/device_info/ios"
Flutter:
:path: Flutter
flutter_statusbar_manager:
:path: ".symlinks/plugins/flutter_statusbar_manager/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
SPEC CHECKSUMS:
ai_amap: ccf21d9cccb9f2171f7331fd6421a287f3712cfa
AMapFoundation: 9ed923193b357ebb30a073e9fe255d3c24054d5a
AMapLocation: c566d448285cd502c1e313063d9e2460bd4d7100
AMapNavi: a47cf864249da145c0055fd31c49c0006da5ce64
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_statusbar_manager: 18588ba7dce7a28a538363d2a9989f9ede4a6710
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
PODFILE CHECKSUM: 40c3bc70fd7ff93654b460f773c92e3806161e85
COCOAPODS: 1.10.0
重点是这里
- AMapFoundation (1.6.3)
- AMapLocation (2.6.5):
- AMapFoundation (~> 1.6.3)
- AMapNavi (7.5.0):
- AMapFoundation (~> 1.6.3)