skip to Main Content

Getting error in react-native project as ahead.

Cycle in dependencies between targets 'BVLinearGradient' and 'FBReactNativeSpec'; building could produce unreliable results.
Cycle path: BVLinearGradient → React → React-RCTAnimation → FBReactNativeSpec → BVLinearGradient
Cycle details:
→ Target 'BVLinearGradient' has link command with output '/Users/imac/Library/Developer/Xcode/DerivedData/NOFOS-gdkwrmnotgdstiglulxxrepqzeci/Build/Products/Debug-iphonesimulator/BVLinearGradient/BVLinearGradient.framework/BVLinearGradient'
○ Target 'BVLinearGradient' has compile command with input '/Volumes/WorkSpace/NOFOS/nofosApp/ios/Pods/Target Support Files/BVLinearGradient/BVLinearGradient-dummy.m'
○ Target 'BVLinearGradient' has write command with output /Users/imac/Library/Developer/Xcode/DerivedData/NOFOS-gdkwrmnotgdstiglulxxrepqzeci/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/BVLinearGradient.build/module.modulemap
→ Target 'React' has target dependency on Target 'React-RCTAnimation'
→ Target 'React-RCTAnimation' has write command with output /Users/imac/Library/Developer/Xcode/DerivedData/NOFOS-gdkwrmnotgdstiglulxxrepqzeci/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/module.modulemap
○ Target 'React-RCTAnimation' has target dependency on Target 'FBReactNativeSpec'
○ That command depends on command in Target 'FBReactNativeSpec': script phase “[CP-User] Generate Specs”
→ Target 'FBReactNativeSpec' has copy command from '/Volumes/WorkSpace/NOFOS/nofosApp/node_modules/react-native/React/FBReactNativeSpec/FBReactNativeSpec/FBReactNativeSpec.h' to '/Users/imac/Library/Developer/Xcode/DerivedData/NOFOS-gdkwrmnotgdstiglulxxrepqzeci/Build/Products/Debug-iphonesimulator/FBReactNativeSpec/FBReactNativeSpec.framework/Headers/FBReactNativeSpec.h'
○ That command depends on command in Target 'FBReactNativeSpec': script phase “[CP-User] Generate Specs”

I have tried with many patterns as mentioned below.

  • Clean build folder >> rebuild.
  • Delete pods and podfile.lock >> pod install.
  • Delete derived data >> clean build folder >> rebuild.
  • close xCode >> rm -rf ~/library/developer/xcode/deriveddata >> rm -rf ~/.rncache >> rm -rf node_modules && npm install && cd ios && rm -rf Pods && pod install && cd ..

I have also restart the system before doing the above trials. And I have used swift in the project.
Please provide me a proper solution for this.

3

Answers


  1. For this particular dependency (react-native-linear-gradient), the fix is in https://github.com/react-native-linear-gradient/react-native-linear-gradient/pull/500 but has not been released yet (when I am writing this).

    You should specify react-native-linear-gradient version from git like this

    package.json

      "react-native-linear-gradient": "https://github.com/react-native-linear-gradient/react-native-linear-gradient#0e3af58",
    

    Then run npm/yarn install, clean your build & try again.

    If issue persist (or is similar) please refer to https://github.com/facebook/react-native/issues/31034#issuecomment-865842707 for a more informations.

    Login or Signup to reply.
  2. I solved a similar problem of a different package by doing ⌘+Shift+K and rebuilding.

    Login or Signup to reply.
  3. For FBReactNativeSpec,

    credit to [paulxuca]’s answer 1

    Click on the Pods project on the left sidebar Go under Build Phases
    Make sure [CP-User] Generate Specs is before Headers

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search