question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When upgrading to 0.64-rc3, error: Cycle in dependencies between targets 'FBReactNativeSpec'

See original GitHub issue

Description

When upgrading to 0.64-rc3, I was stuck for many hours today on this compliation error:

Cycle in dependencies between targets 'BVLinearGradient' and 'FBReactNativeSpec'.

The initial target is irrelevant; if I removed BVLinearGradient it would still happen for many different native libraries and FBReactNativeSpec.

React Native version:

0.64-rc3 on iOS

Steps To Reproduce

Repro was consistent in my project. Maybe has something to do with the fact that I use use_frameworks!, and in the latest sample Podfile React Native does not include this directive.

Workaround

I was able to workaround this issue (and thus want to document it here for others who may get stuck) by:

Navigating to the FBReactNativeSpec target in the Pods project and deleting [CP-User] Generate Specs step.

I then navigated in the terminal to:

<project>/node_modules/react-native/scripts

And I manually ran from the terminal:

./generate-specs.sh

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:25 (2 by maintainers)

github_iconTop GitHub Comments

32reactions
esilverbergcommented, Apr 2, 2021

Here is a proposed solution from @gmapnl in the react-native-screens project:

https://github.com/software-mansion/react-native-screens/issues/842#issuecomment-812543933

post_install do |installer|
  react_native_post_install(installer)
  
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
    end
    
    if (target.name&.eql?('FBReactNativeSpec'))
      target.build_phases.each do |build_phase|
        if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
          target.build_phases.move(build_phase, 0)
        end
      end
    end
  end
end
18reactions
billnbellcommented, Mar 17, 2021

This is not resolved. Still happens on 0.64.x

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cycle in dependencies between targets 'FBReactNativeSpec ...
I solved the problem by doing ⌘+Shift+K and rebuilding.
Read more >
Xcode build error about "cycle" th… | Apple Developer Forums
I have a macOS app target ("MyArchives") and a library target ("HelpPG") in the project. The app uses the library. Logically, there is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found