-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
界面一直 loadding, 日志如下 #4
Comments
是基于最新代码运行的吗? @febobo |
是的,模拟器,真机 都是一样的, android 模拟器能出来界面,但loading 也 一直在,ios 就如图所示 |
好的,我看一下 |
咱们主要以android 来开发的吗?amap_location_fluttify 这个库我竟然没找到ios初始化的位置 |
我试了下可以正常运行的, |
有初始化,之前 iOS 也是可以正常定位的 |
@febobo Android 模拟器同样可以运行,为啥你那边不行,你确定拉了最新代码吗 |
最新版本是 2.3.0 |
刚同步了一下版本,现在好像是appkey 的问题了
|
是的,appkey 被恶意刷导致账号被封了,贼尴尬。。。。不过我加了默认添加北京城市,项目可以正常运行的 |
那你帮忙打个断点看一下 |
cityModels: [CityModel{latitude: NaN, longitude: 5.2150196823839e-310, displayedName: null null, country: null, province: null, city: null, district: null, poiName: null, street: null, streetNumber: null, isLocated: true}] |
我知道了,那就定位成功了,确实返回了结果,但是经纬度错了,导致后续请求天气数据失败了,这个得加个容错,我后面加一下 |
好的,辛苦,有点好奇为啥你们那边没有这个问题呢? |
if (cityModel.latitude == 0.0 || cityModel.longitude == 0.0) {
ToastUtils.show("高德 API 调用上限, 默认添加北京,请见谅", globalKey.currentContext, duration: 5);
cityModel = _buildDefault();
} 因为走了这个逻辑 |
等我账号解封后,将不会公开 appkey ,建议还是自己去官网申请一下 可以吧 |
我刚刚就是用我自己的key跑的 |
你用真机试试呢,按理说经纬不会返回这样的结果 |
明天试试, 辛苦了 |
后续我会重新更新 appkey,保证可以正常定位 |
Performing hot reload...
Reloaded 0 of 912 libraries in 76ms.
flutter: fluttify-dart: AMapLocationManager@105553125612240::requestLocationWithReGeocode(['withReGeocode':true])
UMLOG: event: session_id=750FE94A8995D471515878C7EF06E824, event=located_city_name, label=null null
[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: Unhandled error Converting object to an encodable object failed: Instance of 'CityModel' occurred in Instance of 'CityBloc'.
#0 _JsonStringifier.writeObject (dart:convert/json.dart:687:7)
#1 _JsonStringifier.writeList (dart:convert/json.dart:735:7)
#2 _JsonStringifier.writeJsonValue (dart:convert/json.dart:717:7)
#3 _JsonStringifier.writeObject (dart:convert/json.dart:678:9)
#4 _JsonStringStringifier.printOn (dart:convert/json.dart:876:17)
#5 _JsonStringStringifier.stringify (dart:convert/json.dart:861:5)
#6 JsonEncoder.convert (dart:convert/json.dart:261:30)
#7 JsonCodec.encode (dart:convert/json.dart:171:45)
#8 SPUtil.saveCityModels (package:flutter_dynamic_weather/app/utils/shared_preference_util.dart:22:26)
The text was updated successfully, but these errors were encountered: