【问题标题】:How to fix issue of cycle in dependencies between targets 'BVLinearGrandient' and 'FBReactNativeSpec'?如何解决目标“BVLinearGrandient”和“FBReactNativeSpec”之间依赖关系的循环问题?
【发布时间】:2021-08-25 12:17:00
【问题描述】:

提前在 react-native 项目中出错。

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”

我已经尝试了许多模式,如下所述。

  • 清理构建文件夹 >> 重建。
  • 删除 pod 和 podfile.lock >> pod install。
  • 删除派生数据 >> 清理构建文件夹 >> 重建。
  • 关闭 xCode >> rm -rf ~/library/developer/xcode/deriveddata >> rm -rf ~/.rncache >> rm -rf node_modules && npm install && cd ios && rm -rf Pods && pod install && cd ..

在进行上述试验之前,我也重新启动了系统。我在项目中使用了swift。 请为此提供适当的解决方案。

【问题讨论】:

    标签: ios swift xcode react-native


    【解决方案1】:

    对于这个特定的依赖(react-native-linear-gradient),修复在https://github.com/react-native-linear-gradient/react-native-linear-gradient/pull/500,但还没有发布(当我写这篇文章的时候)。

    你应该像这样从 git 指定 react-native-linear-gradient 版本

    package.json

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

    然后运行 ​​npm/yarn install,清理你的构建并重试。

    如果问题仍然存在(或类似),请参阅https://github.com/facebook/react-native/issues/31034#issuecomment-865842707 了解更多信息。

    【讨论】:

      【解决方案2】:

      我通过执行 ⌘+Shift+K 并重建解决了不同包的类似问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-06-24
        • 2012-04-27
        • 2014-09-06
        • 1970-01-01
        • 2020-06-04
        • 2017-10-07
        • 2019-02-23
        • 2021-12-21
        相关资源
        最近更新 更多