Cycle inside ; building could produce unreliable r

2020-05-13 20:27发布

I am trying to move to the new build system when compiling with Xcode 10. However, it gives following error:

Cycle details:
→ Target 'project' : LinkStoryboards

Target 'project' has compile command with input '/Users/project/Commons/Components/ScreenshotSharing/ViewController/AppShare.storyboard'

Target 'project' : ValidateEmbeddedBinary /Users/project/Xcode/DerivedData/project-hgqvaddkhmzxfkaycbicisabeakv/Build/Products/Debug-iphoneos/project.app/PlugIns/stickers.appex

Target 'project' has process command with input '/Users/project/Resources/Info.plist'

Target 'project' has compile command with input '/Users/project/Commons/Components/ScreenshotSharing/ViewController/AppShare.storyboard'

Screenshot added

Even after removing the problem file, I get same for another xib/storyboard. How can I solve this error without reverting to the legacy build system?

22条回答
beautiful°
2楼-- · 2020-05-13 21:19

In the target's Scheme, find the label Build, and ensure that Find Implicit Dependencies is not checked. These steps may work.

查看更多
老娘就宠你
3楼-- · 2020-05-13 21:19

My solution was simply to Clean Build Folder then re-build.

查看更多
姐就是有狂的资本
4楼-- · 2020-05-13 21:22

I had a similar issue with a mixed interaction between Swift, Objective-C and CoreData: in my project (written in Swift) I made use of Core Data's autogenerated Swift classes as well.

But at one point I needed an Objective C class with public properties (defined in its header counterpart) referring the the core data entities.

#import "ProjectName-Swift.h" // this is to import the swift entities into ObjC

@interface myObjCClass : NSObject

@property (nonatomic) MyCoreDataClass*myEntity;

@end

As soon as I changed the CoreData model, XCode tried to rebuild the classes and I got hung with the indicated cycle build error.

After an initial moment of despair, as I did not have any compile header phases in my project to change the order of, I found out that solution was quite simple:

In the myObjCClass.h I removed the shared Swift header import statement and changed it with a @class directive:

@class MyCoreDataClass; // tell the compiler I will import the class definition somewhere else

// the rest stays the same
@interface myObjCClass : NSObject

@property (nonatomic) MyCoreDataClass*myEntity;

@end

and I moved the #import "ProjectName-Swift.h" statement into the myObjCClass.m class definition file.

#import "myObjCClass.h"
#import "ProjectName-Swift.h"

@implementation myObjCClass

@end

And it builded no worries.

查看更多
戒情不戒烟
5楼-- · 2020-05-13 21:23

I have tried things from this page but the only thing that has helped me was that I made a copy of the target and updated the name of the copy (removed the copy suffix), and deleted the old one, and did pod install afterwards.

查看更多
登录 后发表回答