Baseflow / LottieXamarin

Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
https://baseflow.com
Apache License 2.0
1.22k stars 261 forks source link

Use JsonReader.setLenient(true) to accept malformed JSON at path $ #257

Closed erdugen closed 4 years ago

erdugen commented 4 years ago

🐛 Bug Report

I updated nuget and get this error on android. I am changed animation file but get same error.

"\n --- End of managed Java.IO.IOException stack trace ---\ncom.airbnb.lottie.parser.moshi.JsonEncodingException: Use JsonReader.setLenient(true) to accept malformed JSON at path $\n\tat com.airbnb.lottie.parser.moshi.JsonReader.syntaxError(JsonReader.java:249)\n\tat com.airbnb.lottie.parser.moshi.JsonUtf8Reader.checkLenient(JsonUtf8Reader.java:951)\n\tat com.airbnb.lottie.parser.moshi.JsonUtf8Reader.doPeek(JsonUtf8Reader.java:347)\n\tat com.airbnb.lottie.parser.moshi.JsonUtf8Reader.beginObject(JsonUtf8Reader.java:136)\n\tat com.airbnb.lottie.parser.LottieCompositionMoshiParser.parse(LottieCompositionMoshiParser.java:57)\n\tat com.airbnb.lottie.LottieCompositionFactory.fromJsonReaderSyncInternal(LottieCompositionFactory.java:371)\n\tat com.airbnb.lottie.LottieCompositionFactory.fromJsonReaderSync(LottieCompositionFactory.java:364)\n\tat com.airbnb.lottie.LottieCompositionFactory.fromJsonInputStreamSync(LottieCompositionFactory.java:294)\n\tat com.airbnb.lottie.LottieCompositionFactory.fromJsonInputStreamSync(LottieCompositionFactory.java:287)\n\tat com.airbnb.lottie.LottieCompositionFactory.fromAssetSync(LottieCompositionFactory.java:181)\n\tat com.airbnb.lottie.LottieCompositionFactory$2.call(LottieCompositionFactory.java:146)\n\tat com.airbnb.lottie.LottieCompositionFactory$2.call(LottieCompositionFactory.java:143)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)\n\tat java.lang.Thread.run(Thread.java:919)\n"

Expected behavior

Reproduction steps

Configuration

Version: Lottie version : 3.1.0

Platform:

arscroggin commented 4 years ago

I am also having this problem. JSON file works fine on iOS but I get this exception with the same file on Android. Seems like every Android file I try throws this. Any update on this issue? I'm using Lottie 3.4.2

mathiasnielsen commented 2 years ago

I experienced the same issue (animation worked on iOS but not android), and it turned that the file had some odd format (I guess, BOM or some odd Encoding).. I had some existing json lottie animations files which worked, copied one of them, and changed the content, and it worked... hard error to debug :) Hope it helps.