lottie-react-native: 'Lottie/Lottie.h' file not found on release builds

Dear,

I added lottie-react-native into my project, linked everything and added the framework in build phases. It works well when debugging the project, but when I try to create an archive, it crashes and says 'Lottie/Lottie.h' file not found in LRNAnimationViewManager.

I’m using “lottie-react-native”: “^2.2.0” according to package.json. How do I fix this issue? This is what my build phases looks like: http://prntscr.com/gb97op

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 31 (2 by maintainers)

Most upvoted comments

@dejakob Go to General > Embedded Binaries > add Lottie.framework

Still a problem when releasing the app. I had to add LottieLibraryIOS to Build Phases > Target Dependencies

And i do NOT add Lottie.framework to General > Embedded Binaries or General > Linked Frameworks and Libraries

capture d ecran 2018-03-21 a 12 31 13

capture d ecran 2018-03-21 a 12 34 18

try

react-native link lottie-ios

Where is Lottie.framework located? Can’t seem to find it. I installed with pods.

@felixaa , I think you will want to initially install it using yarn, i.e: yarn add lottie-react-native@2.2.7

Then in your podfile you can add the following:

pod 'lottie-ios', :path => '../node_modules/lottie-ios'
pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

@sinhpn92 @halaszbalazs not sure if you have already solved this issue yet, I may have an answer for you, the point is:

If you are using react-native <=0.58 and lottie-react-natiev@2.6.1, please use lottie-ios@2.5.3 and install normally.

I am using Lottie in two react-native projects. One using 0.59.10 and integrated my own BLE native module written by Swift5 for supporting IoT devices which is completely no problem during installation(I integrated a dummy swift file in case to make Swift support); another one stack at version 0.55.3 and not having any Swift things, this one cost me 2 days to integrate Lottie and I had no see any works solution during stockoverflow or github or somewhere yet.

I think the main reason is caused by not built-in correct Swift support in older version react-native, so when people using lottie-ios > 3.0.0(which is written by Swift), the error shows.

so if someone using lottie-ios@2.5.3 and the error goes, maybe @emilioicai should update the readme file to mention about this.

@benjarwar thanks for the heads up. I’m reopening this issue as it looks like more people are seeing it. The ideal solution would be having react-native link working.

Just to tack onto what @daywong1119 said, I actually already had Lottie.framework in my embedded binaries but I had just upgraded my version of Lottie, so I had to remove the existing version of Lottie.framework and then re-add it.

@dejakob I modified my header search path as below and it achieved fine. screen shot 2017-08-25 at 2 36 43 pm

@sinhpn92 you have to make sure that you first add the the Lottie.xcodeproj from node_modules/lottie-ios/Lottie.xcodeproj to your Libraries in Xcode. Then make sure that the two files libLottie.a and libLottieReactNative.a are under “Linked Frameworks and Libraries”. After that you can click on the plus in “Embedded Binaries” and it should show up under Lottie.xcode.proj>Lottie.frameworkIOS.

The automatic link steps didn’t work for me so I had to do the above. Good Luck!

Still a problem when releasing the app. I had to add LottieLibraryIOS to Build Phases > Target Dependencies

And i do NOT add Lottie.framework to General > Embedded Binaries or General > Linked Frameworks and Libraries

capture d ecran 2018-03-21 a 12 31 13

capture d ecran 2018-03-21 a 12 34 18

thanks bro RN 0.59.5

If you are using pods, remove it from your library and link libraries (make sure it’s not there) and make sure it’s in your target in the Podfile then pod install and rebuild.

Had problems with manually linking on iOS.

Working solution: Add Lottie.xcodeproj & LottieReactNative.xcodeproj to lib/frameworks folder in Xcode Add Lottie.xcodeproj > Products > Lottie.framework & LottieReactNative.xcodeproj > Products > libLottieReactNative.a to your targets Linked Frameworks and Libraries

Voila!

@padupuy Thanks buddy, you da man!

I followed @padupuy and also had the embedded binaries. However, it keeps failing apples build processor after upload to itunes connect.

@padupuy That worked perfectly for me. Thanks heaps!