CocoaPods / CocoaPods/Xcodeproj

[Xcodeproj] Consistency issue: no parent for object `libz.1.dylib`: `FrameworksBuildPhase`, `FrameworksBuildPhase`

Open
#439 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
2.4k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

Just updated to Cocoapods 1.1.1, Xcode 8.1, and Xcodeproj 1.4.0.

We have a ruby script that duplicates an existing target in the project. This has been working for months on Cocoapods 0.39 & Xcode 8.

The ruby code is like this:
```
new_target = source_target.dup
project.targets << new_target
project.save
```

Now when we try out the code we get the following error. The resulting project.pbxproj is 0 bytes.

```
/usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project/object/helpers/groupable_helper.rb:18:in `parent': [Xcodeproj] Consistency issue: no parent for object `libz.1.dylib`: `FrameworksBuildPhase`, `FrameworksBuildPhase` (RuntimeError)
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project/object/build_file.rb:63:in `ascii_plist_annotation'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:286:in `block in to_ascii_plist'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:285:in `each'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:285:in `to_ascii_plist'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:353:in `block in save'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:353:in `open'
from /usr/local/lib/ruby/gems/2.3.0/gems/xcodeproj-1.4.0/lib/xcodeproj/project.rb:353:in `save'
```

I have read similar consistency issues, but they seem related to installing pods or with Xcodeproj 1.3. My pods install fine; the project builds & runs fine in Xcode 8.1

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the target duplication and save sequence shown in the issue, then inspect lib/xcodeproj/project/object/helpers/groupable_helper.rb, build_file.rb, and project.rb at the reported stack frames. Determine why the duplicated FrameworksBuildPhase leaves libz.1.dylib without a parent. Done means the sequence saves without the consistency error and does not produce an empty project.pbxproj.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.