Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode error: Cycle in dependencies #5

Closed
hellogerard opened this issue Sep 4, 2019 · 4 comments
Closed

Xcode error: Cycle in dependencies #5

hellogerard opened this issue Sep 4, 2019 · 4 comments

Comments

@hellogerard
Copy link

Hello,

I've noticed that I can only seem to build everything if I first clean my build folder and do a full rebuild. If I just hit build, I always get this error:

error: Cycle in dependencies between targets 'MyApp' and 'VSCCrypto'; building could produce unreliable results.
Cycle path: MyApp → RNVirgilCrypto → VirgilCrypto → VirgilCryptoFoundation → VSCCrypto → MyApp
Cycle details:
Target build order preserved because “Parallelize Build” is off

→ Target 'MyApp' has target dependency on Target 'RNVirgilCrypto'
→ Target 'RNVirgilCrypto' has compile command with input '/Users/gerard/_work/myapp/react-native/node_modules/react-native-virgil-crypto/ios/RCTConvert+KeyPairType.m'
→ Target 'VirgilCrypto'
→ Target 'VirgilCryptoFoundation'
→ Target 'VSCCrypto' has target dependency on Target 'RNVirgilCrypto' due to target order in a “Target Dependencies” build phase or the scheme

I think I installed the VirgilCrypto Cocoapod correctly. As I said, everything works with a clean build. More info:

  • I did have to set Build Settings -> Packaging -> DEFINES_MODULES -> Yes in the main Pod target in order to get the Pod to get picked up.
  • I have Parallelize Build off in the scheme. Turning this on seems to fix this problem. But a long time ago, this had to be off for React Native to build at all, so I'm a little afraid of enabling this.
  • I'm on React Native 0.59.9. RN 0.60 went fully to Cocoapods (though supposedly backwards-compatible) but maybe if this package was developed on 0.60, some step is missing?

Can anyone help?

@hellogerard
Copy link
Author

Update on this:

  • I actually regressed. I was originally getting a RCTConvert+HashAlgorithm.h:18:9: 'VirgilCrypto-Swift.h' file not found error. I thought that changing DEFINES_MODULES to Yes fixed it, but it still breaks sometimes. So I'm getting that error and the circular dependency error intermittently. But if I try enough times, it builds fine.
  • I dumped CocoaPods and went with the Carthage approach. Everything is building now.

@vadimavdeev
Copy link
Contributor

vadimavdeev commented Sep 9, 2019

Sorry for late response. Glad to know you've managed to find a workaround for the issue. I managed to reproduce this in a new project and I found that just reordering libraries in XCode -> Your Target -> General -> Linked Frameworks and Libraries such that the Pods_<TargetName>.framework is before the libraries and libRNVirgilCrypto.a is the last item, fixes the problem. Here's the screenshot of what I mean -
Screenshot 2019-09-09 17 56 58

And my Podfile looks like this:

target 'RNCryptoIssue' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for RNCryptoIssue

  target 'RNCryptoIssue-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'RNCryptoIssueTests' do
    inherit! :search_paths
    # Pods for testing
  end

  pod 'VirgilCrypto', '~> 5.1.0'
  pod 'VirgilCryptoPythia', '~> 0.10.0'

end

@hellogerard
Copy link
Author

Ah, now working with Pods! Darn, so simple...

I will say also that I needed that pod 'VirgilCryptoPythia', '~> 0.10.0' line in the Podfile, which I did not see anywhere in the README.

I will probably revert Carthage and revert my revert to Pods, since Pods has been embraced by React Native. I did see the issue with RN 0.60, but we are on 0.59 and probably won't upgrade before 0.61 is out.

This issue is good to close on my end.

@vadimavdeev
Copy link
Contributor

Sounds good! I'll add the 'VirgilCryptoPythia' pod requirement in the README. It became a requirement when we started preparing for e3kit integration. I added it to Carthage instructions but missed CocoaPods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants