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'
- The framework has no target dependencies
- The Headers phase is before Compile Sources
- I have gone through every file and made sure that there are no imports grabbing files outside of LoggingSharedFramework (other than Cocoa stuff)
- I am not using any dependency management system (e.g. carthage) because there are no external dependencies. This framework is maintained within the project
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.
defaults write com.apple.dt.XCBuild EnableDebugActivityLogs -bool YES
in terminal then building again? – CottonwoodEnableDebugActivityLogs
but first I figured I should clean up any irrelevant warnings in the framework so that the error would be more apparent. But fixing the umbrella header warnings lead me to the solution I posted below. Thanks for your suggestions. – LinnlinnaeusLoggingSharedFramework
have you checkedXcode Project Settings > Build Phases > Compile Sources
for files that should not be there? – FreimanWframework-include-private-from-public flag
? – Bloxberg