After adding lottie as a dependency to my project, my app will fail to build after 3 or 4 incremental builds with the following error:
:-1: Cycle in dependencies between targets 'Lottie_iOS' and 'RCTVibration'; building could produce unreliable results.
Cycle path: Lottie_iOS → LottieLibraryIOS → RNImagePicker → RNScreens → RNGestureHandler → ReactNativeConfig → RNKeychain → RNVectorIcons → RCTWebSocket → fishhook → RCTVibration → Lottie_iOS
Cycle details:
Target build order preserved because “Parallelize Build” is off
→ Target 'Lottie_iOS' has link command with output '/Users/robertmilejczak/Library/Developer/Xcode/DerivedData/kalosAresM-gfxwbmpklwzgfleeruypwepdspou/Build/Products/Debug-iphonesimulator/Lottie.framework/Lottie'
â—‹ Target 'Lottie_iOS' has compile command with input '/Users/robertmilejczak/Documents/Projects/kalos-mobile/node_modules/lottie-ios/lottie-ios/Classes/RenderSystem/InterpolatorNodes/LOTSizeInterpolator.m'
→ Target 'LottieLibraryIOS' has copy command from '/Users/robertmilejczak/Documents/Projects/kalos-mobile/node_modules/lottie-ios/lottie-ios/Classes/PublicHeaders/LOTValueDelegate.h' to '/Users/robertmilejczak/Library/Developer/Xcode/DerivedData/kalosAresM-gfxwbmpklwzgfleeruypwepdspou/Build/Products/Debug-iphonesimulator/include/Lottie/LOTValueDelegate.h'
→ Target 'RNImagePicker'
→ Target 'RNScreens'
→ Target 'RNGestureHandler'
→ Target 'ReactNativeConfig'
→ Target 'RNKeychain'
→ Target 'RNVectorIcons'
→ Target 'RCTWebSocket'
→ Target 'fishhook'
→ Target 'RCTVibration' has target dependency on Target 'Lottie_iOS' due to target order in a “Target Dependencies” build phase or the scheme
The second library is always some RCT library unless I mess with build settings, but the first library is always Lottie_iOS
This is easily fixed by cleaning the build cache (cmd + option + shift + k) but it's pretty inconvenient since clearing the build cache makes the next subsequent build take a long time.
I've tried all of the suggestions provided by Apple mentioned here: https://help.apple.com/xcode/mac/current/#/dev621201fb0 except for the last which explicitly mentions incremental builds, but would require me to make changes to files that I don't fully understand.
Expected behavior:
The app build succeeds
Actual behavior:
The app build fails
```
react-native: 0.58.3
react: 16.7.0
lottie-react-native: 2.5.11
xcode: 10.1
Also encountering this. But cleaning the build cache does nothing for me.
My workaround was to switch Xcode to the legacy build system, which may not be viable for everybody https://help.apple.com/xcode/mac/current/#/dev396bc94c7
I had the same issue with Lottie and BoringSSL (comes with firebase). This worked for me:
clear your build folder (shift + command + k), then run:
pod repo update
then:
pod install
Try this, it fixed the issue for me: https://github.com/react-native-community/lottie-react-native/issues/385#issuecomment-470494850. It seems like the order that you specify the libraries may affect how they're built, hence the message Target build order preserved because “Parallelize Build” is off
Most helpful comment
I had the same issue with Lottie and BoringSSL (comes with firebase). This worked for me:
clear your build folder (shift + command + k), then run:
pod repo updatethen:
pod install