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

java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path #9

Closed
tayyyab opened this issue Oct 19, 2020 · 6 comments · Fixed by #12
Closed

java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path #9

tayyyab opened this issue Oct 19, 2020 · 6 comments · Fixed by #12
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@tayyyab
Copy link

tayyyab commented Oct 19, 2020

I get this message on HubCallBack methods. The issue only exists in the Android.

I/flutter ( 8673): java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path $

_signalRCallbackHandler Throws an exception.

@AyonAB AyonAB self-assigned this Oct 19, 2020
@AyonAB
Copy link
Contributor

AyonAB commented Oct 19, 2020

What version of the plugin are you using?
If you are not using latest version then change it to the latest, which is v0.0.5 and do a flutter clean after that.

@tomasgaray
Copy link

tomasgaray commented Oct 20, 2020

i have the same issus:
java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path $
happen when the backend send an object.

image

another thing, can you please add a callback by every subscribe HubMethod , cause sometimes, we need to specific thing by callback thanks so much

@AyonAB AyonAB added bug Something isn't working help wanted Extra attention is needed labels Oct 20, 2020
@AyonAB
Copy link
Contributor

AyonAB commented Oct 25, 2020

Although I'm little confused as why StatusChangeCallback is raising this exception cause it was meant to be String. I couldn't quite reproduce the issue but anyway did some changes for a possible fix. @tayyyab or @tomasgaray if any one of you can grab the latest pre-release version (0.0.6-dev.1) from the pub and test it, I'll be glad for that help.

@itsthetaste
Copy link

itsthetaste commented Oct 28, 2020

yes I can confirm that this is working for me now. I can now receive objects.

But as tomas says, there is no way to tell which of the HubMethods triggered the hubCallback.

@AyonAB
Copy link
Contributor

AyonAB commented Oct 28, 2020

Thank you for the feedback and as for the hubCallBack, I'll looking into it once I get some time.

@AyonAB AyonAB linked a pull request Nov 1, 2020 that will close this issue
5 tasks
@furkansoylemez
Copy link

furkansoylemez commented Sep 30, 2022

im getting this exception when server sends a json. Its ok with receiving strings but im in trouble with jsons. Any suggestions? @AyonAB

Edit: I fixed this issue by changing in kotlin code hub.on method class type String to Object and casted received object to string.I can open pull request if its ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants