CocoaPods / CocoaPods/Xcodeproj
"Consistency issue: no parent for object" error on a valid project
- Dominant language
- Ruby
- Stars
- 2.4k
- Forks
- 488
- PR merge metrics
- No merged PRs in 30d
Description
Sample project: [RNCAsyncStorage](https://github.com/react-native-community/async-storage/tree/7042363674fd22aa9b4cb12672d6ed6f06b3b13e/ios)
Opening it with Xcodeproj and saving it without any changes results to an error:
```
RuntimeError: [Xcodeproj] Consistency issue: no parent for object `RNCAsyncStorage.h`: `HeadersBuildPhase`, `CopyFilesBuildPhase`
from gems/xcodeproj-1.9.0/lib/xcodeproj/project/object/helpers/groupable_helper.rb:18:in `parent'
from gems/xcodeproj-1.9.0/lib/xcodeproj/project/object/build_file.rb:63:in `ascii_plist_annotation'
from gems/xcodeproj-1.9.0/lib/xcodeproj/project.rb:296:in `block in to_ascii_plist'
from gems/xcodeproj-1.9.0/lib/xcodeproj/project.rb:295:in `each'
from gems/xcodeproj-1.9.0/lib/xcodeproj/project.rb:295:in `to_ascii_plist'
from gems/xcodeproj-1.9.0/lib/xcodeproj/project.rb:364:in `block in save'
from gems/atomos-0.1.3/lib/atomos.rb:21:in `block in atomic_write'
from lib/ruby/2.4.0/tempfile.rb:295:in `open'
from gems/atomos-0.1.3/lib/atomos.rb:17:in `atomic_write'
from gems/xcodeproj-1.9.0/lib/xcodeproj/project.rb:363:in `save'
```
Still, the project itself is a valid Xcode project that works fine.
Looks like the problem is related to sources that aren't added to any PBXGroup. Maybe we can add some fallback to `ascii_plist_annotation` since this annotation is just a comment? Having no parent group doesn't seem to be illegal from Xcode's point of view.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.