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

"Unable to parse composition" since Lottie NuGet 3.4.0 on Xamarin.Android 11 #309

Closed evgenyvalavin closed 3 years ago

evgenyvalavin commented 3 years ago

🐛 Bug Report

Project uses one of the Lottie animations. There was a need to upgrade to AndroidX libraries and Xamarin.Android 11.

**com.airbnb.lottie.parser.moshi.JsonReader.syntaxError**
com.airbnb.lottie.parser.moshi.JsonEncodingException: Use JsonReader.setLenient(true) to accept malformed JSON at path $

com.airbnb.lottie.parser.moshi.JsonReader.syntaxError JsonReader.java:249
com.airbnb.lottie.parser.moshi.JsonUtf8Reader.checkLenient JsonUtf8Reader.java:951
com.airbnb.lottie.parser.moshi.JsonUtf8Reader.doPeek JsonUtf8Reader.java:347
com.airbnb.lottie.parser.moshi.JsonUtf8Reader.beginObject JsonUtf8Reader.java:136
com.airbnb.lottie.parser.LottieCompositionMoshiParser.parse LottieCompositionMoshiParser.java:57

Expected behavior

Support for UTF-8 with BOM encoded json files as it was before version 3.4.0. For instance, Lottie NuGet 3.0.6 worked fine with UTF-8 with BOM files.

Reproduction steps

Just simply try to play animation.

Looks like it has something to do with "UTF-8 with BOM" encoding. UTF-8 encoded file works just fine. There are two json files in the archive for test purposes: "UTF-8" and "UTF-8 with BOM". utf8_bom.zip

Configuration

Xamarin.Android 11

Version: 3.5.0

Platform:

martijn00 commented 3 years ago

It just uses the native library underneath, so open an issue in that repo please.