cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jongmin Ye (JIRA)" <>
Subject [jira] [Commented] (CB-11258) iOS project.pbxproj file is overwritten after the after-plugin-install hook
Date Tue, 18 Jul 2017 20:04:00 GMT


Jongmin Ye commented on CB-11258:


I found this issue on google, so I joined to let you know this is reproducible.
I am doubting what I did is correct way because I am newbie, so I wrote all I did.

# create project. 
cordova create testProject ...
# add plugins and ios platform
cordova plugin add cordova-plugin-statusbar
cordova plugin add cordova-plugin-whitelist
cordova platform add ios
# add after_plugin_install hook to cordova-plugin-statusbar
//add following line to {PROJ_HOME}/plugins/cordova-plugin-statusbar/plugin.xml
<hook type="after_plugin_install" src="hooks/after_plugin_install.js" />
//open {PROJ_HOME}/plugins/cordova-plugin-statusbar/hooks/after_plugin_install.js file and
paste below codes.
module.exports = function(context) {
    var fs = require('fs');
    var xcode = context.requireCordovaModule('xcode');
    var util = context.requireCordovaModule('cordova-lib/src/cordova/util');
    var ConfigParser = context.requireCordovaModule('cordova-lib/src/configparser/ConfigParser');
    var projectName = new ConfigParser(util.projectConfig(util.isCordova())).name();
    var projectPath = './platforms/ios/' + projectName + '.xcodeproj/project.pbxproj';
    var myProj = xcode.project(projectPath);
    myProj.updateBuildProperty('ENABLE_BITCODE', 'NO');
    fs.writeFileSync(projectPath, myProj.writeSync());
    console.log('✔ BITCODE disable');
# remove and add ios platform
cordova platform rm ios
cordova platform add ios
# Then, you will find there is no `ENABLE_BITCODE` in the project.pbxproj file.

I think only last installed plugin's project.pbxproj modification is not overwritten.
If I move  above hook to cordova-plugin-whitelist, it works.

here is env. 

cordova cli version: 7.0.1
cordova-plugin-statusbar: 2.2.3
cordova-plugin-whitelist: 1.3.2 

If you need further info or I am doing wrong, please let me know.

> iOS project.pbxproj file is overwritten after the after-plugin-install hook
> ---------------------------------------------------------------------------
>                 Key: CB-11258
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-ios
>            Reporter: Edna Morales
>              Labels: cannot-reproduce
> Changes to the project.pbx file made in an after-plugin-install hook get overwritten
after the hook script runs. Specifically it happens when you add the plugin first and then
the iOS platform. If done with the platform first and then the plugin, the changes remain.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message