question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

app:lottie_imageAssetsFolder not work?

See original GitHub issue

I’m using latest version of Lottie (com.airbnb.android:lottie:2.5.0-beta3) but I receive an error when I try to put animation in a folder inside assets (assets/animations/notification.json)

android.view.InflateException: Binary XML file line #57: Binary XML file line #57: Error inflating class com.airbnb.lottie.LottieAnimationView
Caused by: android.view.InflateException: Binary XML file line #57: Error inflating class com.airbnb.lottie.LottieAnimationView
Caused by: java.lang.reflect.InvocationTargetException

I use this code:

<com.airbnb.lottie.LottieAnimationView
                        android:layout_width="match_parent"
                        android:layout_height="250dp"
                        android:layout_marginBottom="@dimen/spacing_normal"
                        android:scaleType="centerCrop"
                        app:lottie_autoPlay="true"
                        app:lottie_fileName="notification.json"
                        app:lottie_imageAssetsFolder="animations/"
                        app:lottie_loop="true"/>

If I put this in assets it works.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
gpealcommented, Feb 6, 2018

No, you can also put your animations in res/raw and reference them though @raw/animationName

0reactions
geolythcommented, Feb 8, 2018

@gpeal Ok, I put all animations in /assets, so all animations works well. Thanks you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't animate images from assets with setImageAssetsFolder
@Qamar4P You're missing the animation itself (the json file). Add the json file exported by bodymovin to assets/ and set app:lottie_fileName=" ...
Read more >
Lottie animation is showing as a still image but not playing
I was able to run the animation with the following code: ... Make sure you're placing your json file in the asset folder,...
Read more >
LottieFiles: Download Free lightweight animations for website ...
Create, edit, test, collaborate, and ship Lottie animations in no time! ... An extensive, curated library of free assets awaits you.
Read more >
Lottie Animations in Flutter - Section.io
First, visit Lottie animation to get a Lottie animation JSON file, then select and download the animation of your choice. Next, create an...
Read more >
Lottie animations in react native - DEV Community ‍ ‍
Now that we have the basic code we are going to work with, is time to import some dependencies: LottieView; Our animation from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found