0

I have animation Lottie and i can't run animation with assets. Animation playing but without assets.

I put my assets in this path. Web player nice playing. But in iOS in console print: -[LOTLayerContainer _setImageForAsset:]: Warn: image not found: img_0.png. For all images so.

Swift code:

let animation = LOTAnimationView(name: "data")
        animation.frame = self.view.frame
        animation.contentMode = .scaleAspectFill
        self.view.addSubview(animation)
        animation.play()

Path:

enter image description here

John John
  • 33
  • 7

2 Answers2

1

for solve this reason it needs to add the json files to copy bundle resources. check the following and if your json file is not there add it there. choose project-> choose the aim target -> goto Build Phases -> check Copy Bundle Resources

enter image description here

mohsen
  • 4,698
  • 1
  • 33
  • 54
0

You need to change

animation = LOTAnimationView(name: "data")

to

animation = AnimationView(name: "data")
RajeshKumar R
  • 15,445
  • 2
  • 38
  • 70
smoo.an
  • 13
  • 6