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条回答
狗以群分
2楼-- · 2020-05-13 21:11

It seems that you need to change the order of the build phases within your Pods targets. For me, moving Headers above the rest worked. You can automate this in your Podfile:

require 'xcodeproj'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    headers_phase = target.build_phases.find { |p| p.kind_of?(Xcodeproj::Project::Object::PBXHeadersBuildPhase) }
    if headers_phase
      puts "#{target.name}: Moving Headers build phase to top"
      target.build_phases.insert(0, target.build_phases.delete_at(target.build_phases.index(headers_phase)))
    end
  end
end
查看更多
forever°为你锁心
3楼-- · 2020-05-13 21:14

Core_Data

I had the same problem and error but mine happened when I "Created NSManagedObject Subclass" for my entity and I faced this error. So if you think your error is same as mine about Core Data what can probably help you (and helped me ) is to:

  • click on your Entity in you "xcdatamodel" file
  • go to your right bar click on Data Model Inspector
  • change "Module" to "Current Product Module"
  • and finally, change "Codegen" to "Manual/None"
  • clean and build

I think because in other scenarios Xcode creates a file automatically and when we create another one it causes a conflict.

查看更多
乱世女痞
4楼-- · 2020-05-13 21:15

My issue had to do with a cyclical dependency between my swift bridging header and my objective c files.

In my objective c header files I had a #import "...-swift.h" file and then in a couple of my swift files I was including those files with said import and thus causing a cyclical dependency.

This is the StackOverflow that led me to find the solution:

Objective C, Swift Interoperability issue due to circular dependency

How to prevent circular reference when Swift bridging header imports a file that imports Hopscotch-Swift.h itself

EDIT:

I wound up converting the above files to swift and this solved my issue.

查看更多
\"骚年 ilove
5楼-- · 2020-05-13 21:17

Same issue on Version 10.0 beta 3 (10L201y) and I wanted to have the New Build System.

Problem is had disabled Enable Modules (C and Objective-C)

in Build Settings -> Apple Clang - Language - Modules

After enabling it (set to YES) got rid of the Error.

查看更多
Viruses.
6楼-- · 2020-05-13 21:17

I've met similar issue when tried to archive my project on Xcode 10. Here's the detail text:

→ Target 'mytarget': CodeSign /path/to/mytarget.app

○ Target 'mytarget': SetGroup staff /path/to/mytarget.app

○ Target 'mytarget': SetMode u+w,go-w,a+rX /path/to/mytarget.app

○ Target 'mytarget': SetGroup staff /path/to/mytarget.app

Fixed it by setting $(USER) in mytarget -> Build Settings -> Deployment -> Install Owner

查看更多
三岁会撩人
7楼-- · 2020-05-13 21:18

Following two options worked for me: File->Project/Workspace settings.

1, Change the build system to "Legacy Build system" in File->Project Settings

2, Edit Scheme and Select "Parallelize Build" option under Build section.

查看更多
登录 后发表回答