app:lottie_imageAssetsFolder not work?
See original GitHub issueI’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:
- Created 6 years ago
- Comments:5
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

No, you can also put your animations in res/raw and reference them though
@raw/animationName@gpeal Ok, I put all animations in /assets, so all animations works well. Thanks you