New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.3.0 Animations no longer appear (upgrading from 1.2 to 2.3) #242
Comments
Having the same issue. I don't remember why I upgraded in the first place. In my case some animations play and some don't. I am downgrading and testing. I'll post feedback. |
Ok, I can't use 1.2.0 due to this: #169 I have checked the code and there has veen a major change in 2.2.5 where the JSON is loaded in a different way. I am testing 2.2.0 right now, which handled RN 0.47 but does not change the way the animation is loaded. Edit: 2.2.0 shows the animation directly at 100%, on the last frame. This is very annoying. |
1.2 was the last working version from what I can see but I cannot use it because I've upgraded my react-native to .50 which 1.2 is not supported in that version of react-native. The 2.2 versions don't animate my animations in some cases even though I am using the exact same component for every single animation that I have, which is very weird, and 2.3 doesn't render the animation at all. |
If 1.2.0 works for you, the only issue I know about is the override. I just solved it adding a postinstall script in the package.json, that executes this (place it in a folder called 'scripts'):
Is ugly code but what it does is to remove the Override decorator that brings issues with RN because I don't want to do it manually. In my case, I just installed 2.2.7 again, made a clean build again and my animations are working again. I have no idea. Maybe the gradle cache has something to do with it. I don't plan on touching anything else. |
@RyanMitchellWilson Can you post your component that uses Lottie with its styles? |
@gpeal Sure here is my component.
This component used to work perfectly in 1.2, but in the 2.2 update this doesn't animate in a few places but does in most places in the app and 2.3 doesn't even appear on the screen, all using this code. |
I've tried every combo of RN and RNLottie, nothing loads ever for me |
@RyanMitchellWilson I just pasted your sample component into the sample app in this repo and it worked on Android as well as iOS. I'd love to fix this if I can repro it. |
@ErkanSensei If you attach a sample project that repros this, I can take a look. |
@gpeal Ya that is the weird part, it works in almost every case I use it in except for a couple places. And that only started happening after I upgraded from lottie-react-native 1.2. I think it could be related to trying to call play on the reference when it could be trying to render. Is there a way to just tell the component to always play instead of calling |
Same issue here, weirdly it's only happening on iOS. "lottie-react-native": "2.3.1",
"react-native": "0.51.0", So I tried to do the classic link/unlink/reinstall XCode dance, didn't work. So I rolled back to: "lottie-react-native": "2.3.0",
"react-native": "0.50.4", But, much to my surprise, it still happens. So I can't really pinpoint where or how - it used to work just fine until today. Only other change that happened was XCode 9.1 -> XCode 9.2, but I can't rollback that. Here's my animation: export default class LoadingView extends React.PureComponent {
componentDidMount() {
this.animation.play();
}
render() {
return (
<View style={styles.container}>
<Animation
ref={(animation) => {
this.animation = animation;
}}
style={styles.animation}
source={animationLoading}
imageAssetsFolder={'lottie/images'}
loop
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.sunsetGlow,
alignItems: 'center',
justifyContent: 'center',
},
animation: {
width: Device.width, // 1500
height: Device.height, // 2668
transform: [{ scale: 0.5 }],
},
}); |
Has anyone found a workaround for this issue? We have one animation that won't play, but everything else works fine... "react-native": "0.50.3", |
Since I can't repro this, I'd appreciate any assistance in reproing/fixing this by the way. If you can figure out a solution, I can merge and publish it asap. |
Hey @gpeal did something change lately (native/ios side) on how the assets must be imported in XCode? 🤔 |
@kelset I send the json as a string rather than a serialized dictionary. This improved serialization perf ~10x. |
That just affects how it's send over the js bridge in rn though |
Still nothing ? I have an 200x200 square with nothing (it's supposed to be my lottie). It stopped working after upgrading react-native to 0.51.0 and lottie-react-native to 2.3.1... |
@Yalaouf I can't repro it on my devices. If you can help debug and potentially even put up a PR, that would be great. Is it iOS only, Android, or both? |
Ok, do you have a test json I can use to check the difference with mine? I feel it may be related to that 🤔 |
This may be related to We are able to reproduce this as well. |
@jeffsteinmetz I was having the same problem and found the reason. Looks like the location of the xcodeproj of lottie-react-native has changed, and although the project still builds, the lottie-rn source files won't get built, resulting in the error in #248. You can notice the problem by checking your Libraries in the project navigator and see if If still doesn't work, make sure the library is being included in the project Build Phases -> Link Binary with Libraries |
Hey @oNaiPs, you were correct, I had the same issue (actually, the RNLottie lib wasn't linked at all!). So prob there's some underlying issue with the EDIT: Ok, looks like it's really So, yeah, @gpeal it's 99.9% the EDIT2: oook thanks to the mighty power of lottie+XCode not getting configured properly (this issue still happens way too frequently) now it doesn't work again. If anyone can provide a full example repo working with both platforms in 2.3.1 please link it here. |
@oNaiPs |
I reported that before but that change is breaking the builds. #241 I don't think this is related, otherwise not even the build could be able to compile. |
I found that a thorough reinstall of Lottie fixed it for me. Had the same issue after upgrading to RN 51 and lottie-react-native@2.3.1 Here's what I did: In Xcode, remove Lottie.framework from Embedded Binaries
Then in Xcode re-add Lottie.framework to Embedded Binaries After these steps |
excuse the stupid question but where can I find I tried the steps above to install lottie-react-native for the first time on iOS but nothing is working. I'm using the
|
I ran into this problem as well, after upgrading from version
In Now do the following:
DO NOT RUN THE
|
I'm having this problem on Android, but only in the simulator. To complicate further, it's using expo, so there's no linking issues going on, maybe it's a separate problem... |
ANDROID FIX!!! // works IOS not Android // Works on both Android and IOS ANDROID // Workaround <Lottie |
Hi, "react": "16.2.0", Have you any other suggestions? |
For me the issue ended up being that scaling in Android is tricky. TLDR; android doesn't scale, but it can be transformed to change the size (but only to make it bigger, doesn't work to make smaller, will clip). |
closing due to inactivity |
#242 (comment) Thank's that solved my problem! |
I just upgraded to lottie-react-native 2.3.0 and now none of my animations are showing up. I have had my same code working since version 1.2 and now with 2.3 it doesn't event show up. Does anyone know how to fix this?
The text was updated successfully, but these errors were encountered: