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

JsonEncodingException when call LottieAnimationView.setAnimationFromUrl #1950

Closed
KeWeize opened this issue Nov 25, 2021 · 2 comments · Fixed by #1954
Closed

JsonEncodingException when call LottieAnimationView.setAnimationFromUrl #1950

KeWeize opened this issue Nov 25, 2021 · 2 comments · Fixed by #1954

Comments

@KeWeize
Copy link

KeWeize commented Nov 25, 2021

Describe the bug
Lottie 4.2.1
call LottieAnimationView.setAnimationFromUrl(..),when download zip file's Content-Type is not 'application/zip',maybe is 'application/x-zip' or "application/x-zip-compressed",exception occurs:
Caused by: com.airbnb.lottie.parser.moshi.JsonEncodingException: Use JsonReader.setLenient(true) to accept malformed JSON at path $
at com.airbnb.lottie.parser.moshi.JsonReader.syntaxError(JsonReader.java:249)
at com.airbnb.lottie.parser.moshi.JsonUtf8Reader.checkLenient(JsonUtf8Reader.java:952)
at com.airbnb.lottie.parser.moshi.JsonUtf8Reader.doPeek(JsonUtf8Reader.java:348)
at com.airbnb.lottie.parser.moshi.JsonUtf8Reader.beginObject(JsonUtf8Reader.java:137)

Screenshots
image
Only Content-Type 'application/zip' be handled as '.ZIP' file

@KeWeize
Copy link
Author

KeWeize commented Nov 25, 2021

I'm so sorry for my poor grammar~.~

@gpeal
Copy link
Collaborator

gpeal commented Nov 25, 2021

I can add x-zip and x-zip-compressed to the list of supported MIME types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants