iosxcodecircular-dependencyxcode10

Xcode 10 framework dependency cycle with itself


On Xcode 10 I'm getting this build error with one of my frameworks when I do an incremental build (clean builds work):

Showing All Messages
:-1: Cycle inside LoggingSharedFramework; building could produce unreliable results.
Cycle details:
→ Target 'LoggingSharedFramework' has a command with output 'blablabla/Build/Products/Debug-iphonesimulator/LoggingSharedFramework.framework/LoggingSharedFramework'
○ Target 'LoggingSharedFramework' has link command with output 'blablabla/Build/Intermediates.noindex/blablablah/Debug-iphonesimulator/LoggingSharedFramework.build/Objects-normal/x86_64/LoggingSharedFramework'

This error makes no sense to me. What is the actual cause? How can I figure out what is introducing the cycle? How can I fix the cycle?

Here's the debug build log I get:

Build system information
error: target:  ->

node: <all> ->

command: <all> ->

node: .../DerivedData/MyApp/Build/Products/Debug-iphoneos/LoggingSharedFramework.framework/LoggingSharedFramework ->

command: 60cc809630:Debug:CreateUniversalBinary .../DerivedData/MyApp/Build/Products/Debug-iphoneos/LoggingSharedFramework.framework/LoggingSharedFramework normal armv7 arm64 ->

node: .../DerivedData/MyApp/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/LoggingSharedFramework.build/Objects-normal/armv7/LoggingSharedFramework ->

command: 60cc809630:Debug:Ld .../DerivedData/MyApp/Build/Intermediates.noindex/MyApp.build/Debug-iphoneos/LoggingSharedFramework.build/Objects-normal/armv7/LoggingSharedFramework normal armv7 ->

node: .../DerivedData/MyApp/Build/Products/Debug-iphoneos/LoggingSharedFramework.framework/LoggingSharedFramework

** BUILD FAILED **

I guess there is a cycle there, but I don't understand why it exists or how to fix it. It looks like Ld on some intermediate object depends on the compiled framework? That makes no sense to me.

I previously thought that I had fixed this by moving my headers build phase earlier, fixing umbrella header warnings, and cleaning my build. But it turns out that that was only a temporary fix. This problem seems to reappear randomly and once Xcode detects a cycle it won't go away until I clean again. Then it stays gone for a while into some unknown cause brings it back.


Solution

  • This problems seems to have resolved itself in Xcode 10.2