# Getting the exception on sending images as MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 path

**URL:** <https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028>\
**Category:** Android\
**Tags:** group-channel, chatsdk\
**Created:** [September 6, 2021, 8:26am UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028 "2021-09-06T08:26:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Development\_Account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/development_account/32/1584_2.png) [@Development\_Account](https://community.sendbird.com/u/Development_Account)\
**Post date:** [September 6, 2021, 8:26am UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028/1 "2021-09-06T08:26:35Z")

</div>

**Getting the exception on sending images as "MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 path"**

```auto
result = {SendBirdException@25502}
 code = 800130
 backtrace = null
 cause = {SendBirdException@25502} 
  code = 800130
  backtrace = null
  cause = {SendBirdException@25502} 
  detailMessage = "com.sendbird.android.shadow.com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 path $"
  stackTrace = {StackTraceElement[12]@25505} 
  suppressedExceptions = {Collections$EmptyList@25495} size = 0
  shadow$_klass_ = {Class@17871} 
  shadow$_monitor_ = 1073746918
 detailMessage = "com.sendbird.android.shadow.com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 2 column 2 path $"

```

---

<div class="post-metadata">

**Author:** ![Cjeon](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cjeon/32/222_2.png) [@Cjeon](https://community.sendbird.com/u/Cjeon)\
**Post date:** [September 7, 2021, 5:19am UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028/2 "2021-09-07T05:19:15Z")

</div>

Hi @Development_Account , it seems like our server sent malformed json as a response. Can you provide some info so we can reproduce it on our end? What method did you call? What parameters did you pass? Also having the logs filtered with “SendBird” would help. Sorry for the trouble and we will try our best to help you solve the issue.

---

<div class="post-metadata">

**Author:** ![Development\_Account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/development_account/32/1584_2.png) [@Development\_Account](https://community.sendbird.com/u/Development_Account)\
**Post date:** [September 8, 2021, 8:36am UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028/3 "2021-09-08T08:36:52Z")

</div>

We are calling below mentioned method

```auto
BaseChannel.class 
public FileMessage sendFileMessage() {}

```

we are passing below properties

```auto
File file, 
String name, 
String type, 
int size, 
String data, 
String customType, 
List<ThumbnailSize> thumbnailSizes,
BaseChannel.SendFileMessageWithProgressHandler handler

```

**SDK Version:-** sendbird-android-sdk:3.0.171

---

<div class="post-metadata">

**Author:** ![Cjeon](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/cjeon/32/222_2.png) [@Cjeon](https://community.sendbird.com/u/Cjeon)\
**Post date:** [September 9, 2021, 12:41am UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028/4 "2021-09-09T00:41:23Z")

</div>

@Development_Account Thank you for the reply. We tested the above method internally but we were unable to reproduce the issue. We can try other ways but this would need some more info that I cannot gather for now. Could you please contact our support team (solutions engineers) so that we can help you debug further? Please tell them my name - `Cheolho Jeon` and link to here so that we could accelerate the process.

---

<div class="post-metadata">

**Author:** ![Development\_Account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/development_account/32/1584_2.png) [@Development\_Account](https://community.sendbird.com/u/Development_Account)\
**Post date:** [September 15, 2021, 1:27pm UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028/5 "2021-09-15T13:27:09Z")

</div>

@Cjeon Please let me know how can I contact support team (solutions engineers)?

Do I need to send an email & please share the email If any or else do I need to seclude call, if so please share the link to raise the request?

---

<div class="post-metadata">

**Author:** ![Tyler](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/tyler/32/810_2.png) [@Tyler](https://community.sendbird.com/u/Tyler)\
**Post date:** [September 15, 2021, 3:01pm UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028/6 "2021-09-15T15:01:58Z")

</div>

Hi @Development_Account,

Do you have an active subscription with Sendbird? If so, you can raise a request from your Sendbird dashboard via the email icon in the upper right hand corner.

---

<div class="post-metadata">

**Author:** ![Development\_Account](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/development_account/32/1584_2.png) [@Development\_Account](https://community.sendbird.com/u/Development_Account)\
**Post date:** [April 11, 2022, 5:35am UTC](https://community.sendbird.com/t/getting-the-exception-on-sending-images-as-malformedjsonexception-use-jsonreader-setlenient-true-to-accept-malformed-json-at-line-2-column-2-path/3028/7 "2022-04-11T05:35:31Z")

</div>

@Tyler Thanks for providing the information.
