openkraken / kraken

A web standards-compliant, high-performance rendering engine based on Flutter.
https://openkraken.com
Apache License 2.0
4.93k stars 304 forks source link

急急急,发现flutter 集成 kraken 后无法正常发送大图片,不引入kraken 不会 #1171

Closed yuchonghua closed 2 years ago

yuchonghua commented 2 years ago

使用的 Kraken 版本 | What version of kraken are you using

重现步骤 | Steps To Reproduce

重现代码 | Code example:

_picker.pickImage(source: ImageSource.gallery) .then((XFile? file) async { print('file'); print(file!.path);

        var uri = 'http://10.111.80.89:18008/'+file!.name;
        HttpClient httpClient = HttpClient();

        var request = await httpClient.openUrl('PUT', Uri.parse(uri));
        request.headers.set(HttpHeaders.contentLengthHeader, await file.length());
        await request.addStream(file.openRead());
        // await request.flush();
        //3.关闭请求,等待响应
        var response = await request.close();
        var responseBody = '';
        //4.进行解码,获取数据
        try {
          responseBody = await response.transform(utf8.decoder).join();
        } catch (ee) {
          responseBody = '';
        }
        print('bg-00-5');
        // pp.readAsBytes
        print('responseBody');
        print(responseBody);
        // print(uri);
        return {
          'url': 'responseBody'
        };
      });

预期结果 | Expected results:

实际结果 | Actual results: image

出现了D/SurfaceView( 6466): UPDATE Surface(name=SurfaceView - com.guanmengzs.chat_app/com.guanmengzs.chat_app.MainActivity)/@0x5c84c75, mIsProjectionMode = false E/flutter ( 6466): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: RangeError: Value not in range: -171360 E/flutter ( 6466): #0 _NativeSocket.write (dart:io-patch/socket_patch.dart:1092:20) E/flutter ( 6466): #1 _RawSocket.write (dart:io-patch/socket_patch.dart:1765:15) E/flutter ( 6466): #2 _Socket._write (dart:io-patch/socket_patch.dart:2198:18) E/flutter ( 6466): #3 _SocketStreamConsumer.write (dart:io-patch/socket_patch.dart:1946:26) E/flutter ( 6466): #4 _Socket._onData (dart:io-patch/socket_patch.dart:2169:19) E/flutter ( 6466): #5 _rootRunUnary (dart:async/zone.dart:1444:13) E/flutter ( 6466): #6 _CustomZone.runUnary (dart:async/zone.dart:1335:19) E/flutter ( 6466): #7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7) E/flutter ( 6466): #8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11) E/flutter ( 6466): #9 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7) E/flutter ( 6466): #10 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19) E/flutter ( 6466): #11 _StreamController._add (dart:async/stream_controller.dart:607:7) E/flutter ( 6466): #12 _StreamController.add (dart:async/stream_controller.dart:554:5) E/flutter ( 6466): #13 new _RawSocket. (dart:io-patch/socket_patch.dart:1707:23) E/flutter ( 6466): #14 _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:1239:14) E/flutter ( 6466): #15 _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:1246:7) E/flutter ( 6466): #16 _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1267:11) E/flutter ( 6466): #17 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12) E/flutter ( 6466):

wssgcg1213 commented 2 years ago

可以先把缓存关掉, HttpCacheController.mode = HttpCacheMode.NO_CACHE;

这个问题我来看一下

yuchonghua commented 2 years ago

非常感谢您的回答

yuchonghua commented 2 years ago

image image 问题依旧不行,项目急上线,有解决冲突的方法吗 /ping @wssgcg1213

wssgcg1213 commented 2 years ago

能确定是引入 Kraken 之后才有的异常吗

yuchonghua commented 2 years ago

非常确定,是使用了Kraken就不行,在有 Kraken 组件的页面弹出了任何页面,包括 Kraken 都无法正常使用HttpClient传输完所有流

yuchonghua commented 2 years ago

您方便加个微信吗? 283114511

image

yuchonghua commented 2 years ago

您那边可以用 image_picker 上传大文件吗?我使用了Kraken 渲染就不行,急等解决冲突,这个冲突太致命了...

wssgcg1213 commented 2 years ago
image

最近建了一个社区群 可以在这里找到我们