margelo / react-native-skottie

▶️ Efficient lottie animations using Skia's Skottie module
https://margelo.io
MIT License
846 stars 22 forks source link

Error while using dotLottie files. #40

Open ISnowFoxI opened 4 months ago

ISnowFoxI commented 4 months ago

When you try to use dotLottie files with rn-skottie it throws the below error. Android logcat seemed to give the same information as well.

...

import {Skottie} from 'react-native-skottie';
import {cameraPermission, micPermission} from '../../../assets/animations';

    ...

    <Skottie
          style={styles.animationStyle}
          source={micPermission}
          autoPlay
          loop
          resizeMode="contain"
    />

    ...

Here are some example files: dotLottieFiles.zip

Sidenote: When I download files from lottie files, they download as a zip, so I have to manually convert the file extention to .lottie. Don't think it has anything to do with it.

dotLottie

sabaturgay commented 3 months ago

Hi,

I've started using rn-skottie and noticed significant performance improvements. Thanks for the great work! However, this issue is preventing me from publishing my app on Android. Is there any progress on this issue? I need to decide whether to plan the release with rn-skottie or postpone its use.

Thanks in advance for your response.

ISnowFoxI commented 3 months ago

@sabaturgay for now, you should postpone it, Margelo team is hard at work migrating all libraries to new arch and stuff. So they are very busy at the moment.

sabaturgay commented 3 months ago

Sure, Thanks for the quick response.

thecynicalpaul commented 3 months ago

I am also getting an error when dealing with dotLottie files (After Effects source). Exception in HostFunction: animations/data.json not present in dotLottie file

thecynicalpaul commented 3 months ago

Update to potentially help with investigation of this: I've tried two differnt workflows for exporting .lottie files from After Effects, and one of them works on rn-skottie.

(1) This doesn't work and throws Exception in HostFunction: animations/data.json not present in dotLottie file: AE -> AE Lottie Extension to upload to lottifiles -> export project as an unoptimized dotLottie

(2) This works without throwing errors AE -> AE Lottie Extension to upload to lottifiles -> export project as an unoptimized json -> upload json to https://lottiefiles.com/tools/lottie-to-dotlottie -> download optimized dotLottie

Note: files produced by either of these workflows work with react-native-lottie. Note 2: Interestingly, the rasterized segments with shadows don't show up in the working dotLottie files. (They work in JSON files, and do show up in react-native-lottie or lottiefiles web when using the optimized dotLottie)