Lottie-android: There's a Exception to load json file, I provide the json

Created on 30 Mar 2017  路  5Comments  路  Source: airbnb/lottie-android

I don't know if the something wrong with json, but it was exported by AE. Please spend some time, Thanks very much!

I found something wrong in codes. If json contains ".png", must provide the images folder. I use AI and then Export into AE, it has no png images! @seanfchan

failed_anim.json.zip

java.lang.IllegalStateException: 
You must set an images folder before loading an image. Set it with LottieComposition#setImagesFolder or LottieDrawable#setImagesFolder                                                           
at com.airbnb.lottie.ImageAssetBitmapManager.bitmapForId(ImageAssetBitmapManager.java:70)

Most helpful comment

@SwayChen When you import an Illustrator layer, convert your AI layer to a shape layer or else bodymovin will export it as a png.
https://helpx.adobe.com/after-effects/atv/cs6-tutorials/converting-imported-vector-graphics-from-illustrator-to-shape-la.html

All 5 comments

@SwayChen not exactly sure what the problem is, but here a few thing to try.

  1. Some data json generated by bodymovin is also accompanied by an image, did you try putting the image in the asset folder as well?
  2. You can try calling LottieAnimationView#setImageAssetsFolder to set which folder Lottie should try to search for assets

@gpeal any other thoughts?

@SwayChen When you import an Illustrator layer, convert your AI layer to a shape layer or else bodymovin will export it as a png.
https://helpx.adobe.com/after-effects/atv/cs6-tutorials/converting-imported-vector-graphics-from-illustrator-to-shape-la.html

Thanks for your reply, I will try it!

I just found the documentation about AI layers and the tip about converting them to shapes in bodymovin wiki bodymovin/bodymovin/wiki/Shapes#illustrator-layers

@fdnhkj Thanks a lot! I just send the wiki page to our designer :)

Was this page helpful?
0 / 5 - 0 ratings