Skip to content

Unable to read xcode(8.2.1) project  #121

Description

@wajahatch888

I am using following code to read xcode project and add one header file But it fails.

var xcode = require('xcode'),
    fs = require('fs'),
    projectPath = '/Users/Wajahat/Desktop/JASONETTE-iOS/app/Jasonette.xcodeproj/project.pbxproj',
    myProj = xcode.project(projectPath);

// parsing is async, in a different process
myProj.parse(function (err) {
    myProj.addHeaderFile('testheader.h');
   
   

    fs.writeFileSync(projectPath, myProj.writeSync());
    console.log('new project written');
});

I am getting following error

TypeError: Cannot read property 'path' of null
at correctForPath (/Users/Wajahat/Desktop/electron-quick-start-master/node_modules/xcode/lib/pbxProject.js:1586:38)
at correctForPluginsPath (/Users/Wajahat/Desktop/electron-quick-start-master/node_modules/xcode/lib/pbxProject.js:1572:12)
at pbxProject.addPluginFile (/Users/Wajahat/Desktop/electron-quick-start-master/node_modules/xcode/lib/pbxProject.js:89:5)
at pbxProject.addHeaderFile (/Users/Wajahat/Desktop/electron-quick-start-master/node_modules/xcode/lib/pbxProject.js:197:21)
at pbxProject. (/Users/Wajahat/Desktop/electron-quick-start-master/xcodetest.js:9:12)
at emitTwo (events.js:106:13)
at pbxProject.emit (events.js:191:7)
at pbxProject. (/Users/Wajahat/Desktop/electron-quick-start-master/node_modules/xcode/lib/pbxProject.js:31:18)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)

Can anybody tell what i am doing wrong? Thanks in advance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions