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

Lottie 4.0.7 doesn't work on Xamarin.Forms Android project #302

Closed jmarti326 closed 4 years ago

jmarti326 commented 4 years ago

💬 Questions and Help

Hi, I was able to made it work on iOS, but in Android I am unable to view the animation. After some Google search some recommend to install the Com.Airbnb.Android.Lottie along side Com.Airbnb.Xamarin.Forms.Lottie but this just makes the app crash once is install in the emulator.

I would like to know if there is a special step I need to do for the new version 4.0.7.

martijn00 commented 4 years ago

Target Android 10 and use the latest visual studio.

jmarti326 commented 4 years ago

Hi @martijn00 thank you for taking the time to comment on my open item. I do have the following configuration, if there is anything I need to change or fix other than that, please let me know. Again, thank you for the time.

Error I am getting when deploying and opening the app in the Android Simulator. Screen Shot 2020-11-23 at 2 42 35 PM

Nuget Install in the Android Project Screen Shot 2020-11-23 at 2 47 29 PM

MainPage.xaml Screen Shot 2020-11-23 at 2 48 08 PM

Android Target Framework Screen Shot 2020-11-23 at 2 50 12 PM

martijn00 commented 4 years ago

You need to use AndroidX instead of Android Support v7.

jmarti326 commented 4 years ago

We might be getting closer. 😅🙈

I looked for this error online, and tried a couple of recommendations. Still continue to have the error.

Screen Shot 2020-11-23 at 5 14 05 PM

Screen Shot 2020-11-23 at 5 12 26 PM

jmarti326 commented 4 years ago

After a little bit of more google search, and a comment from a team member, I was able to get the library working in Android.

Need to go to Toolbar.xml inside the layout folder.

Change android.support.v7.widget.Toolbar

To androidx.appcompat.widget.Toolbar

image

Result

image

jmarti326 commented 4 years ago

@martijn00 Thank you for your help. :)