Skip to content
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

Closed
febobo opened this issue Sep 14, 2020 · 20 comments
Closed

界面一直 loadding, 日志如下 #4

febobo opened this issue Sep 14, 2020 · 20 comments
Assignees
Labels
定位失败 定位失败,搜索失败,因为 API 被刷导致账号被封

Comments

@febobo
Copy link

febobo commented Sep 14, 2020

image

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)

@xiaweizi
Copy link
Owner

是基于最新代码运行的吗? @febobo

@febobo
Copy link
Author

febobo commented Sep 14, 2020

是基于最新代码运行的吗? @febobo

是的,模拟器,真机 都是一样的, android 模拟器能出来界面,但loading 也 一直在,ios 就如图所示

@xiaweizi
Copy link
Owner

是基于最新代码运行的吗? @febobo

是的,模拟器,真机 都是一样的, android 模拟器能出来界面,但loading 也 一直在,ios 就如图所示

好的,我看一下

@febobo
Copy link
Author

febobo commented Sep 14, 2020

是基于最新代码运行的吗? @febobo

是的,模拟器,真机 都是一样的, android 模拟器能出来界面,但loading 也 一直在,ios 就如图所示

好的,我看一下

咱们主要以android 来开发的吗?amap_location_fluttify 这个库我竟然没找到ios初始化的位置 __

@xiaweizi
Copy link
Owner

是基于最新代码运行的吗? @febobo

是的,模拟器,真机 都是一样的, android 模拟器能出来界面,但loading 也 一直在,ios 就如图所示

好的,我看一下

咱们主要以android 来开发的吗?amap_location_fluttify 这个库我竟然没找到ios初始化的位置 __

我试了下可以正常运行的,
目前定位和搜索功能不能暂时使用,因为有人恶意刷我的高德 appKey 导致我账号被封,目前正在申请解封,所以我暂时定位和搜索添加都是背景,容错一下,之前是可以的

@xiaweizi
Copy link
Owner

是基于最新代码运行的吗? @febobo

是的,模拟器,真机 都是一样的, android 模拟器能出来界面,但loading 也 一直在,ios 就如图所示

好的,我看一下

咱们主要以android 来开发的吗?amap_location_fluttify 这个库我竟然没找到ios初始化的位置 __

image

有初始化,之前 iOS 也是可以正常定位的

@xiaweizi
Copy link
Owner

@febobo Android 模拟器同样可以运行,为啥你那边不行,你确定拉了最新代码吗

@xiaweizi
Copy link
Owner

@febobo Android 模拟器同样可以运行,为啥你那边不行,你确定拉了最新代码吗

最新版本是 2.3.0

@xiaweizi xiaweizi pinned this issue Sep 14, 2020
@febobo
Copy link
Author

febobo commented Sep 14, 2020

@febobo Android 模拟器同样可以运行,为啥你那边不行,你确定拉了最新代码吗

最新版本是 2.3.0

刚同步了一下版本,现在好像是appkey 的问题了
UMLOG: event: session_id=CF6F60DA676DF26026BC40D905417E0C, event=located_city_name, label=null null
flutter: flutter-weather: null: 开始插入城市数据 CityModel{latitude: NaN, longitude: 5.2150180562708e-310, displayedName: null null, country: null, province: null, city: null, district: null, poiName: null, street: null, streetNumber: null, isLocated: true}
flutter: flutter-weather: SPUtil: getCityModels
flutter: flutter-weather: null: sp-get: null
flutter: flutter-weather: SPUtil: saveCityModels 1
[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)

#9 CityBloc.insertCityMode (package:flutter_dynamic_weather/bloc/city/city_bloc.dart:143:18)

#10 CityBloc.mapEventToState (package:fl<…>
Key验证失败

BundleID:com.example.flutterDynamicWeather
Key:9a313effeb3ba1be5dfdcc42308d7d07
SDK:AMAP_SDK_iOS_Loc_2.6.5
csid:F24E4C39-58B4-41FC-B890-AE41DBFBF821
gsid:033003220173160008166078400019302411732
info:INVALID_REQUEST
time:20200914 190740

请在高德开放平台官网中搜索【INVALID_REQUEST】相关内容进行解决。
多谢合作。

@xiaweizi
Copy link
Owner

xiaweizi commented Sep 14, 2020

@febobo Android 模拟器同样可以运行,为啥你那边不行,你确定拉了最新代码吗

最新版本是 2.3.0

刚同步了一下版本,现在好像是appkey 的问题了
UMLOG: event: session_id=CF6F60DA676DF26026BC40D905417E0C, event=located_city_name, label=null null
flutter: flutter-weather: null: 开始插入城市数据 CityModel{latitude: NaN, longitude: 5.2150180562708e-310, displayedName: null null, country: null, province: null, city: null, district: null, poiName: null, street: null, streetNumber: null, isLocated: true}
flutter: flutter-weather: SPUtil: getCityModels
flutter: flutter-weather: null: sp-get: null
flutter: flutter-weather: SPUtil: saveCityModels 1
[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)

#9 CityBloc.insertCityMode (package:flutter_dynamic_weather/bloc/city/city_bloc.dart:143:18)

#10 CityBloc.mapEventToState (package:fl<…>
Key验证失败

BundleID:com.example.flutterDynamicWeather
Key:9a313effeb3ba1be5dfdcc42308d7d07
SDK:AMAP_SDK_iOS_Loc_2.6.5
csid:F24E4C39-58B4-41FC-B890-AE41DBFBF821
gsid:033003220173160008166078400019302411732
info:INVALID_REQUEST
time:20200914 190740

请在高德开放平台官网中搜索【INVALID_REQUEST】相关内容进行解决。
多谢合作。

是的,appkey 被恶意刷导致账号被封了,贼尴尬。。。。不过我加了默认添加北京城市,项目可以正常运行的

@xiaweizi
Copy link
Owner

insertCityMode

那你帮忙打个断点看一下 city_bloc line 143 中的 cityModels 对象是不是为空导致空白的

@febobo
Copy link
Author

febobo commented Sep 14, 2020

insertCityMode

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}]

@xiaweizi
Copy link
Owner

insertCityMode

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}]

我知道了,那就定位成功了,确实返回了结果,但是经纬度错了,导致后续请求天气数据失败了,这个得加个容错,我后面加一下

@febobo
Copy link
Author

febobo commented Sep 14, 2020

我知道了,那就定位成功了,确实返回了结果,但是经纬度错了,导致后续请求天气数据失败了,这个得加个容错,我后面加一下

好的,辛苦,有点好奇为啥你们那边没有这个问题呢?

@xiaweizi
Copy link
Owner

我知道了,那就定位成功了,确实返回了结果,但是经纬度错了,导致后续请求天气数据失败了,这个得加个容错,我后面加一下

好的,辛苦,有点好奇为啥你们那边没有这个问题呢?

      if (cityModel.latitude == 0.0 || cityModel.longitude == 0.0) {
        ToastUtils.show("高德 API 调用上限, 默认添加北京,请见谅", globalKey.currentContext, duration: 5);
        cityModel = _buildDefault();
      }

因为走了这个逻辑

@xiaweizi
Copy link
Owner

我知道了,那就定位成功了,确实返回了结果,但是经纬度错了,导致后续请求天气数据失败了,这个得加个容错,我后面加一下

好的,辛苦,有点好奇为啥你们那边没有这个问题呢?

      if (cityModel.latitude == 0.0 || cityModel.longitude == 0.0) {
        ToastUtils.show("高德 API 调用上限, 默认添加北京,请见谅", globalKey.currentContext, duration: 5);
        cityModel = _buildDefault();
      }

因为走了这个逻辑

等我账号解封后,将不会公开 appkey ,建议还是自己去官网申请一下 可以吧

@febobo
Copy link
Author

febobo commented Sep 14, 2020

好的,辛苦,有点好奇为啥你们那边没有这个问题呢?

我刚刚就是用我自己的key跑的

@xiaweizi
Copy link
Owner

好的,辛苦,有点好奇为啥你们那边没有这个问题呢?

我刚刚就是用我自己的key跑的

你用真机试试呢,按理说经纬不会返回这样的结果

@febobo
Copy link
Author

febobo commented Sep 14, 2020

好的,辛苦,有点好奇为啥你们那边没有这个问题呢?

我刚刚就是用我自己的key跑的

你用真机试试呢,按理说经纬不会返回这样的结果

明天试试, 辛苦了

@xiaweizi
Copy link
Owner

后续我会重新更新 appkey,保证可以正常定位

@xiaweizi xiaweizi added the 定位失败 定位失败,搜索失败,因为 API 被刷导致账号被封 label Sep 15, 2020
@xiaweizi xiaweizi self-assigned this Sep 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
定位失败 定位失败,搜索失败,因为 API 被刷导致账号被封
Projects
None yet
Development

No branches or pull requests

2 participants