Flutter 问题合集

 收录Flutter踩坑中遇见的问题和解决办法。


无法Hot Reload,提示Error connecting to the service protocol: HttpException: , uri = http://127.0.0.1:8113/ws

解决方法:

打开 XCODE - Window - Devices and Simulators,找到用来调试的设备

取消勾选 Connect via network,如果之前就未打钩,先选择再取消勾选


网络请求数据返回 json.decode 报Json Formatter错误

在封装网络库的的时候发现 底层 response.data['data']时候当是一个jsonarray时候竟然无法直接取出'data',"Stirng not subType of Index "错误,原因是 此时拿到的不是一个json数据,没有双引号的假json数据,但是在jsonobject却可以,解决如下

if(callBack !=null) {  String res2Json  = json.encode(response.data);  Map map=json.decode(res2Json);  callBack(map["data"]);}


带了Flutter,提交AppStore报错

报错如下:

App Store Connect Operation Error

Unsupported Architectures. The executable for xxx.app/Frameworks/Flutter.framework contains unsupported architectures '[x86_64]'.

App Store Connect Operation Error

Invalid Segment Alignment. The app binary at 'xxx.app/Frameworks/Flutter.framework/Flutter' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version.

App Store Connect Operation Error

The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker.

解决方法:

你可能感兴趣的:(Flutter 问题合集)