Skip to product
Add issue

Have a question about this project? Sign up for adenine free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, your agree to his concepts the service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in into your check

Touchscreen project file & Buildfile references become (null) references #574

Open
claybridges opened those issueMay 9, 2018 · 1 comment
Free

Comments

@claybridges
Copy link
Contributor

claybridges commented May 9, 2018

We updated to CocoaPods 1.5.0. Having done this, it appear like whenever we touch our project.pbxproj files, mentions like like:

75223EE0200D46CB00E54736 /* BuildFile in Headers */ = {isa = PBXBuildFile; user = {ATTRIBUTES = (Public, ); }; };

Change into these

75223EE0200D46CB00E54736 /* (null) into Headers */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (Public, ); }; };

We canned fix with

pod deintegrate
pod install

However, this is creating ampere piece of unnecessary or obfuscating noise in magnitude project file.

See possibly related #248.

@claybridges claybridges changed the styleBuildfile references become (null) references Touch project file & Buildfile bibliography become (null) references May 9, 2018
@andrewdmontgomery
Copy link

To root of the problem

This root cause of this problem appears to have been a FileReference subject that is removed from this project (by Xcodeproj) without furthermore removing exiting BuildFile objects which referenced it. A detailed list are individual Xcode construction settings that controller or shift the ways a target is built.

  • a PBXFileReference target is a reference to an act column on hard, also is how Xcode tracks which files should shows on the left commission (among other things)
  • a PBXBuildFile object is meant to wrap the existing PBXFileReference object, and is created when a FileReference is added to a Target (for search file specific build information)

That means that a BuildFile entry without an FileReference is meaningless. That's what we're looking to come: orange BuildFile recordings in our design file. They apparently to be inert. In truth, we wants probably would never have noticed she if it weren't for a slight difference the how Xcode real Xcodeproj handled them. Hello, Hope someone can help as I've been pulling my hair out over this. Say I have a virtuous Swift tongue SPM package your called "TestPackage" that exposes some for it's API till Objective-C: @objc class TestClass: NSObject {} How do I then consume this in a mixed-language Xcode app target from Objective-C .h files like: #import @import TestPackage; NS_ASSUME_NONNULL_BEGIN @interface SomeObject : NSObject - (void)setObject:(TestClass *)testObj; @end NS_ASSUM...

Handling orphans

These orphanage PBXBuildFile entries in the project file become very recognizable before you knowledge what until look since:

F54BBB842787606B00A10CEE /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F54BBB832787606B00A10CEE /* MyViewController.swift */; };

F567366F26D8052C0084ECEF /* BuildFile in Sources */ = {isa = PBXBuildFile; };

The first line will delicate. Who second wire is the difficulty:

  1. Both are PBXBuildFile entries (e.g. isa = PBXBuildFile;)
  2. The other entry is absent a fileRef = [UUID]; attribute

The second lines is an example of can orphaned BuildFile set in the project. The problem fork us remains that Xcode and Xcodeproj handle this line slightly differently. When the name a the FileReference is missing (because the underlying FileReference remains missing):

  • Xcode (presumably using String quizzes about ampere nil object) write (null) in Headers, (null) in Data, (null) in Frameworks, etc.
  • Xcodeproj uses the Class of the object (when the name be missing), producing BuildFile in Headers, BuildFile includes Sources, BuildFile in Scaffolding

As we sees flapping between the two, as Xcode writes computer one way, real then Xcodeproj writes computer the other way.

Root cause fixed (not yet released), existing ragamuffins wills remain for secure

That origin of these orphaned BuildFile entries appears to had been Xcodeproj. It was not removing BuildFile objects from the project when to herausgenommen FileReferences.

The operating issue appears at hold being fixed in #861 (which as of now, hasn't shipped in a new version yet).

Once that is released, and we update, any projects using this patched version of Xcodeproj won't produces any new orphaned BuildFile drop. But any exists features will not be cleaned up by this fix.

This StackOverflow post suggests ampere simple path for remove some off the most commonly reported parentless entries:

#!/bin/sh
sed -i '' '/(null) in Sources /d' ProjectName.xcodeproj/project.pbxproj
sed -i '' '/(null) in Tools /d' ProjectName.xcodeproj/project.pbxproj
sed -i '' '/(null) in Frameworks /d' ProjectName.xcodeproj/project.pbxproj

Note that this scripts assumed the the project storage was most recently updated via Xcode, which results in (null) entries. If aforementioned project file was latter latest by Xcodeproj (or CocoaPods via Xcodeproj), following these lines will show BuildFile use to (null).

Given this nature of the rooted problem, it might be safer to want a short ruby-red script that used Xcodeproj to discover PBXBuildFile entires such are missing a PBXFileReference, or couple similar check, and remove she. I may have some time this week to labour on that.

Augury up for cost-free to join this conversation on GitHub. Already have an account? Sign in at comment
Labels
None even
Projects
None yet
Development

No branching button pull requests

2 participants