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

Cycle in dependencies between targets 'CrashReporter macOS Framework' and 'CrashReporter macOS' #194

Closed
MoShenGuo opened this issue Jun 25, 2021 · 9 comments
Labels

Comments

@MoShenGuo
Copy link

你好 运行报错
报错日志:Cycle in dependencies between targets 'CrashReporter macOS Framework' and 'CrashReporter macOS'; building could produce unreliable results.
Cycle path: CrashReporter macOS Framework → CrashReporter macOS → CrashReporter macOS Framework
Cycle details:
Target build order preserved because “Parallelize Build” is off

→ Target 'CrashReporter macOS Framework' has create directory command with output '/Users/bodadmin/Library/Developer/Xcode/DerivedData/CrashReporter-eksjldrdulnvktfokjsnyazxddza/Build/Products/Debug-macosx/CrashReporter.framework/Versions'
→ Target 'CrashReporter macOS': Libtool /Users/bodadmin/Library/Developer/Xcode/DerivedData/CrashReporter-eksjldrdulnvktfokjsnyazxddza/Build/Intermediates.noindex/CrashReporter.build/Debug-macosx/CrashReporter macOS.build/Objects-normal/arm64/Binary/libCrashReporter.a normal arm64
○ Target 'CrashReporter macOS' has compile command with input '/Users/bodadmin/Downloads/plcrashreporter-master/Source/PLCrashReporterNSError.m'
→ Target 'CrashReporter macOS Framework' has write command with output /Users/bodadmin/Library/Developer/Xcode/DerivedData/CrashReporter-eksjldrdulnvktfokjsnyazxddza/Build/Intermediates.noindex/CrashReporter.build/Debug-macosx/CrashReporter macOS Framework.build/module.modulemap
image
还望指教

@DmitriyKirakosyan DmitriyKirakosyan changed the title 你好 下载你的项目运行报错 是什么原因呢 Cycle in dependencies between targets 'CrashReporter macOS Framework' and 'CrashReporter macOS' Jun 25, 2021
@russelarms
Copy link
Contributor

Hi @MoShenGuo, thanks for reaching out! I could reproduce the issue.
Repro steps:

  1. build "CrashReporter macOS"
  2. build "CrashReporter macOS Framework"
  3. build "CrashReporter"
  4. build "CrashReporter macOS Framework"

@MoShenGuo what Xcode version do you use?

The current workaround is to clean cache:
Product > Clean Build Folder.

@MatkovIvan
Copy link
Contributor

@russelarms It's most likely due to implicit dependencies finding on new Xcode versions (we faced with this Xcode bug before). Make sure that targets have unchecked "Find Implicit Dependencies" setting in build scheme.

@AnastasiaKubova
Copy link
Contributor

We haven’t heard from you in a while so I’m closing this issue but feel free to reopen this issue if you have additional questions.

@richardgroves
Copy link
Contributor

I'm seeing this problem with the latest code and all 'Find Implicit Dependencies' unchecked for every scheme. Using XCode 12.5.1. Same scenario as above: Do one successful build and the next one will fail with an error. Have to clean + full rebuild to work around, which isn't great.

Cycle in dependencies between targets 'CrashReporter iOS Framework' and 'CrashReporter iOS'; building could produce unreliable results. This usually can be resolved by moving the target's Headers build phase before Compile Sources.
Cycle path: CrashReporter iOS Framework → CrashReporter iOS → CrashReporter iOS Framework
Cycle details:
→ Target 'CrashReporter iOS Framework': Libtool /Users/richard/Library/Developer/Xcode/DerivedData/CrashReporter-duzgqhmryouqdqemdmlrxtbbntwu/Build/Products/Debug-iphonesimulator/CrashReporter.framework/CrashReporter normal
○ Target 'CrashReporter iOS Framework': MasterObjectLink /Users/richard/Library/Developer/Xcode/DerivedData/CrashReporter-duzgqhmryouqdqemdmlrxtbbntwu/Build/Intermediates.noindex/CrashReporter.build/Debug-iphonesimulator/CrashReporter iOS Framework.build/Objects-normal/CrashReporter-x86_64-master.o
○ Target 'CrashReporter iOS Framework' has compile command with input '/Users/richard/Code/Tools and Components/PLCrashReporter/Source/CrashReporterFramework.m'
○ Target 'CrashReporter iOS Framework' has process command with input '/Users/richard/Code/Tools and Components/PLCrashReporter/Source/PLCrashNamespace.h'
○ Target 'CrashReporter iOS Framework' has write command with output /Users/richard/Library/Developer/Xcode/DerivedData/CrashReporter-duzgqhmryouqdqemdmlrxtbbntwu/Build/Intermediates.noindex/CrashReporter.build/Debug-iphonesimulator/CrashReporter iOS Framework.build/module.modulemap
○ Target 'CrashReporter iOS Framework' has target dependency on Target 'CrashReporter iOS'
→ Target 'CrashReporter iOS' has compile command with input '/Users/richard/Code/Tools and Components/PLCrashReporter/Source/CrashReporter.m'

@AnastasiaKubova
Copy link
Contributor

Thanks for mention it. I will label this issue as a bug.

@aleksandr-dorofeev
Copy link
Contributor

Hi @MoShenGuo and @richardgroves Please, try to use this branch v-adorofeev/fix-cycle-in-dependencies and check if it works for you.

@richardgroves
Copy link
Contributor

@aleksandr-dorofeev Looks good to me - was able to build the iOS version a second time without any errors.

@DmitriyKirakosyan
Copy link
Contributor

Actually, this fix doesn't handle all cases and the error Cycle in dependencies can still happen when switching between targets in PLCrashReporter project. However, I believe it is more an Xcode bug.
The PR looks OK though, and all CI checks are passed. I'll do a bit more of manual testing and merge the PR.

@DmitriyKirakosyan
Copy link
Contributor

PR is merged.
I'm closing this issue, but feel free to reopen if you face the issue again.

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

No branches or pull requests

7 participants