openimsdk / open-im-sdk-flutter

IM SDK Flutter
https://openim.io
MIT License
357 stars 225 forks source link

[BUG] jsondecode failed with empty message when send picture/video in ios device #113

Closed osangma closed 9 months ago

osangma commented 1 year ago

OpenIM-App] * --------assets type-----AssetType.image, isError [false] 2023-07-27 05:32:24.589 INFO [PID:37214] [open_im_sdk/util.go:245] input req {"operationID": "1690435944517", "function name": "open_im_sdk/internal/conversation_msg.(Conversation).CreateImageMessageFromFullPath-fm", "args": ["/private/var/mobile/Containers/Data/Application/071B857A-5C07-4F21-BA25-DCE8B083FBC1/tmp/flutter-images/4d8004bfc31689632c45fff93b02393b_exif.jpg"]} fnv: 0x1056b3b80 ins: [<*context.valueCtx Value> /private/var/mobile/Containers/Data/Application/071B857A-5C07-4F21-BA25-DCE8B083FBC1/tmp/flutter-images/4d8004bfc31689632c45fff93b02393b_exif.jpg] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: FormatException: Unexpected end of input (at character 1) ^

0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)

1 _ChunkedJsonParser.close (dart:convert-patch/convert_patch.dart:501:7)

2 _parseJson (dart:convert-patch/convert_patch.dart:36:10)

3 JsonDecoder.convert (dart:convert/json.dart:610:36)

4 JsonCodec.decode (dart:convert/json.dart:216:41)

5 jsonDecode (dart:convert/json.dart:155:10)

6 Utils.formatJson

utils.dart:12

7 Utils.toObj

utils.dart:8

environment: iphone 13 mini:

flutter_openim_sdk: git: url: git@github.com:OpenIMSDK/Open-IM-SDK-Flutter.git ref: main OpenimSdkCore 3.0.1

ios真机发送图片/视频消息时,sdkcore 返回的message为空,导致flutter无法jsondecode

osangma commented 12 months ago

any updates?

std-s commented 11 months ago

Refer to the open source demo.

abel-wang-git commented 7 months ago

Same question Simulator can send Physical devices are not working

std-s commented 7 months ago

@abel-wang-git hi, initSDK( "dataDir: path,") this input parameter needs to end with "/". like this: "dataDir: xx/xx/"