Getting Dependency cycle error with Xcode 13, when app target have no dependency on test target

Project consists of three targets

  • main ios app target
  • unit test target
  • Library target consists of helper classes

Here both unit test and library target are dependent on the main ios app target. Unit test target is also dependent on library target. Project is getting build fine with Xcode 12.

With Xcode 13 when I build the project for testing I am getting dependency cycle error, main ios app target has no dependency on the test target. I created a SampleApplication to reproduce the issue. Here is the error

Cycle in dependencies between targets 'SampleApplicationTests' and 'SampleApplication'; building could produce unreliable results.
Cycle path: SampleApplicationTests → SampleApplicationLibrary → SampleApplication → SampleApplicationTests
Cycle details:
→ Target 'SampleApplicationTests': CodeSign /Users/username/Library/Developer/Xcode/DerivedData/SampleApplication-egkbepxwlbsmhydjejzeaoonvqcu/Build/Products/Debug-iphonesimulator/SampleApplication.app/PlugIns/SampleApplicationTests.xctest
○ Target 'SampleApplicationTests' has process command with output '/Users/username/Library/Developer/Xcode/DerivedData/SampleApplication-egkbepxwlbsmhydjejzeaoonvqcu/Build/Products/Debug-iphonesimulator/SampleApplication.app/PlugIns/SampleApplicationTests.xctest/Info.plist'
○ Target 'SampleApplicationTests' has create directory command with output '/Users/username/Library/Developer/Xcode/DerivedData/SampleApplication-egkbepxwlbsmhydjejzeaoonvqcu/Build/Products/Debug-iphonesimulator/SampleApplication.app/PlugIns/SampleApplicationTests.xctest'
→ Target 'SampleApplicationLibrary' has target dependency on Target 'SampleApplication'
→ Target 'SampleApplication': CodeSign /Users/username/Library/Developer/Xcode/DerivedData/SampleApplication-egkbepxwlbsmhydjejzeaoonvqcu/Build/Products/Debug-iphonesimulator/SampleApplication.app
→ Target 'SampleApplicationTests' has create directory command with output '/Users/username/Library/Developer/Xcode/DerivedData/SampleApplication-egkbepxwlbsmhydjejzeaoonvqcu/Build/Products/Debug-iphonesimulator/SampleApplication.app/PlugIns/SampleApplicationTests.xctest'

I have the same issue. Did you capable to find some solution?

Getting Dependency cycle error with Xcode 13, when app target have no dependency on test target
 
 
Q