Lottie-react-native: Cycle in dependencies between targets 'Lottie_iOS' and SOME_LIBRARY building could produce unreliable results, after incremental builds

Created on 1 Feb 2019  Â·  3Comments  Â·  Source: lottie-react-native/lottie-react-native

Description

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

Steps to Reproduce

  1. Create a react-native project, add and link lottie as a dependency following the install instructions
  2. Build the project in XCode several times (usually 3 or 4)
  3. Observe this error

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

Versions

```
react-native: 0.58.3
react: 16.7.0
lottie-react-native: 2.5.11
xcode: 10.1

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 update

then:

pod install

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

snydercreative picture snydercreative  Â·  4Comments

Jpunt picture Jpunt  Â·  4Comments

kyleleite picture kyleleite  Â·  4Comments

ASkyBig picture ASkyBig  Â·  4Comments

androsanta picture androsanta  Â·  5Comments