Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.1.6 is breaking android builds #16

Closed
akshayakrsh opened this issue Nov 13, 2015 · 6 comments
Closed

Version 1.1.6 is breaking android builds #16

akshayakrsh opened this issue Nov 13, 2015 · 6 comments

Comments

@akshayakrsh
Copy link

Hi @dpa99c,

The version 1.1.6 is breaking the android builds for us. The error we get is:

/var/lib/jenkins/jobs/Mobile-App-Build/workspace/Cordova/plugins/cordova-custom-config/hooks/applyCustomConfig.js:396
st'), xcode = require('xcode'), tostr = require('tostr'), fileUtils = require(
                                                                    ^
ReferenceError: fileUtils is not defined
    at applyCustomConfig.init (/var/lib/jenkins/jobs/Mobile-App-Build/workspace/Cordova/plugins/cordova-custom-config/hooks/applyCustomConfig.js:400:79)

Any idea why?

@dpa99c
Copy link
Owner

dpa99c commented Nov 13, 2015

Looks like I introduced another race condition while trying to fix other race conditions :-(

I can't reproduce it with Android platform on Windows, so (going by your paths) it may be specific to Android on OSX. I don't have Android SDK setup on my Mac right now, but will setup and try to repro when I have some time later.

In the meantime:

What operation appears to cause the error? prepare, platform add, platform rm, plugin add, plugin rm?

I see you're using Jenkins so the build is automated, but if possible can you manually run the offending operation from the CLI with --verbose argument and post the log output here?

@dpa99c
Copy link
Owner

dpa99c commented Nov 14, 2015

I've tested android on OSX and can't reproduce the error you're seeing.

I've created a couple of regression test scripts in the example project. Could you run the android one in your build environment and see if the error occurs?

This is the output I get from running regression_test/android.sh on OSX:

Last login: Sat Nov 14 18:48:12 on ttys000
Daves-Mac:~ dave$ git clone https://github.com/dpa99c/cordova-custom-config-example.git
Cloning into 'cordova-custom-config-example'...
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 34 (delta 1), reused 0 (delta 0), pack-reused 29
Unpacking objects: 100% (34/34), done.
Checking connectivity... done.
Daves-Mac:~ dave$ cd cordova-custom-config-example/
Daves-Mac:cordova-custom-config-example dave$ ls
config.xml  regression_test www
Daves-Mac:cordova-custom-config-example dave$ regression_test/android.sh 
Executing "before_platform_add"  hook for all plugins.
No version supplied. Retrieving version from config.xml...
Adding android project...
Failed to require PlatformApi instance for platform "android". Using polyfill instead.
Running command: /Users/dave/.cordova/lib/npm_cache/cordova-android/4.1.1/package/bin/create /Users/dave/cordova-custom-config-example/platforms/android uk.co.workingedge.phonegap.plugins.example.customconfig "Custom config plugin example" --cli
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: uk.co.workingedge.phonegap.plugins.example.customconfig
    Name: Custom config plugin example
    Activity: MainActivity
    Android target: android-22
Copying template files...
Android project created with cordova-android@4.1.1
Command finished with error code 0: /Users/dave/.cordova/lib/npm_cache/cordova-android/4.1.1/package/bin/create /Users/dave/cordova-custom-config-example/platforms/android,uk.co.workingedge.phonegap.plugins.example.customconfig,Custom config plugin example,--cli
Executing "before_prepare"  hook for all plugins.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_prepare"  hook for all plugins.
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Executing "before_plugin_add"  hook for all plugins.
Calling plugman.fetch on plugin "cordova-plugin-whitelist@1.0.0"
Fetching plugin "cordova-plugin-whitelist@1.0.0" via npm
Copying plugin "/Users/dave/.npm/cordova-plugin-whitelist/1.0.0/package" => "/Users/dave/cordova-custom-config-example/plugins/cordova-plugin-whitelist"
Calling plugman.install on plugin "/Users/dave/cordova-custom-config-example/plugins/cordova-plugin-whitelist" for platform "android
Installing "cordova-plugin-whitelist" for android
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Executing "before_plugin_install"  hook for "cordova-plugin-whitelist" on android.
Install start for "cordova-plugin-whitelist" on android.
Beginning processing of action stack for android project...
Action stack processing complete.
Install complete for cordova-plugin-whitelist on android.
Executing "after_plugin_install"  hook for "cordova-plugin-whitelist" on android.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_add"  hook for all plugins.
Discovered plugin "cordova-custom-config" in config.xml. Installing to the project
Executing "before_plugin_add"  hook for all plugins.
Calling plugman.fetch on plugin "cordova-custom-config@1"
Fetching plugin "cordova-custom-config@1" via npm
Copying plugin "/Users/dave/.npm/cordova-custom-config/1.1.6/package" => "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config"
Calling plugman.install on plugin "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config" for platform "android
Installing "cordova-custom-config" for android
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Executing "before_plugin_install"  hook for "cordova-custom-config" on android.
Install start for "cordova-custom-config" on android.
Beginning processing of action stack for android project...
Action stack processing complete.
Install complete for cordova-custom-config on android.
Executing "after_plugin_install"  hook for "cordova-custom-config" on android.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_add"  hook for all plugins.
saving android@4.1.1 into platforms.json
Executing "after_platform_add"  hook for all plugins.
cordova-custom-config: All module dependencies are installed
Executing "before_prepare"  hook for all plugins.
cordova-custom-config: Running restoreBackups.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_prepare"  hook for all plugins.
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Can't find module fs-extra, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Can't find module lodash, running npm install
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Can't find module elementtree, running npm install
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "plist"
cordova-custom-config: Can't find module plist, running npm install
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Can't find module xcode, running npm install
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Can't find module tostr, running npm install
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Can't find module dummy, running npm install
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Created backup directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup
cordova-custom-config: Created backup platform directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android
cordova-custom-config: Backed up /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml to /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android/AndroidManifest.xml
cordova-custom-config: Applied custom config from config.xml to /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "plist"
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Checking to see if there are backups to restore...
cordova-custom-config: Restored backup of 'AndroidManifest.xml' to :/Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
Executing "before_plugin_rm"  hook for all plugins.
Calling plugman.uninstall on plugin "cordova-custom-config" for platform "android"
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Executing "before_plugin_uninstall"  hook for "cordova-custom-config" on android.
Uninstalling cordova-custom-config from android
Beginning processing of action stack for android project...
Action stack processing complete.
Removing "cordova-custom-config"
Deleted "cordova-custom-config"
Removing plugin cordova-custom-config from fetch.json
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_rm"  hook for all plugins.
cordova-custom-config: There was an error reading the file: Error: ENOENT, open '/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/package.json'
Executing "before_plugin_add"  hook for all plugins.
no version specified, retrieving version from config.xml
Calling plugman.fetch on plugin "cordova-custom-config@1"
Fetching plugin "cordova-custom-config@1" via npm
Copying plugin "/Users/dave/.npm/cordova-custom-config/1.1.6/package" => "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config"
Calling plugman.install on plugin "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config" for platform "android
Installing "cordova-custom-config" for android
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version 
Executing "before_plugin_install"  hook for "cordova-custom-config" on android.
Install start for "cordova-custom-config" on android.
Beginning processing of action stack for android project...
Action stack processing complete.
Install complete for cordova-custom-config on android.
Executing "after_plugin_install"  hook for "cordova-custom-config" on android.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_add"  hook for all plugins.
cordova-custom-config: All module dependencies are installed
Executing "before_prepare"  hook for all plugins.
cordova-custom-config: Running restoreBackups.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_prepare"  hook for all plugins.
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Can't find module fs-extra, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Can't find module lodash, running npm install
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Can't find module elementtree, running npm install
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "plist"
cordova-custom-config: Can't find module plist, running npm install
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Can't find module xcode, running npm install
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Can't find module tostr, running npm install
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Can't find module dummy, running npm install
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Created backup directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup
cordova-custom-config: Created backup platform directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android
cordova-custom-config: Backed up /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml to /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android/AndroidManifest.xml
cordova-custom-config: Applied custom config from config.xml to /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "plist"
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Checking to see if there are backups to restore...
cordova-custom-config: Restored backup of 'AndroidManifest.xml' to :/Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
Executing "before_platform_rm"  hook for all plugins.
Removing android from platforms.json file ...
Executing "after_platform_rm"  hook for all plugins.
Daves-Mac:cordova-custom-config-example dave$ 

@akshayakrsh
Copy link
Author

Hey,

Thanks for ur reply. Apologies for the delayed response. So, the build we are doing is using Jenkins on a RHEL 6 server not on my OSX machine. I will still try ur solution and add the logs here.

Thnx!

Sent from my iPhone

On 15-Nov-2015, at 2:05 AM, Dave Alden notifications@github.com wrote:

I've tested android on OSX and can't reproduce the error you're seeing.

I've created a couple of regression test scripts in the example project. Could you run the android one in your build environment and see if the error occurs?

This is the output I get from running regression_test/android.sh on OSX:

Last login: Sat Nov 14 18:48:12 on ttys000
Daves-Mac:~ dave$ git clone https://github.com/dpa99c/cordova-custom-config-example.git
Cloning into 'cordova-custom-config-example'...
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 34 (delta 1), reused 0 (delta 0), pack-reused 29
Unpacking objects: 100% (34/34), done.
Checking connectivity... done.
Daves-Mac:~ dave$ cd cordova-custom-config-example/
Daves-Mac:cordova-custom-config-example dave$ ls
config.xml regression_test www
Daves-Mac:cordova-custom-config-example dave$ regression_test/android.sh
Executing "before_platform_add" hook for all plugins.
No version supplied. Retrieving version from config.xml...
Adding android project...
Failed to require PlatformApi instance for platform "android". Using polyfill instead.
Running command: /Users/dave/.cordova/lib/npm_cache/cordova-android/4.1.1/package/bin/create /Users/dave/cordova-custom-config-example/platforms/android uk.co.workingedge.phonegap.plugins.example.customconfig "Custom config plugin example" --cli
Creating Cordova project for the Android platform:
Path: platforms/android
Package: uk.co.workingedge.phonegap.plugins.example.customconfig
Name: Custom config plugin example
Activity: MainActivity
Android target: android-22
Copying template files...
Android project created with cordova-android@4.1.1
Command finished with error code 0: /Users/dave/.cordova/lib/npm_cache/cordova-android/4.1.1/package/bin/create /Users/dave/cordova-custom-config-example/platforms/android,uk.co.workingedge.phonegap.plugins.example.customconfig,Custom config plugin example,--cli
Executing "before_prepare" hook for all plugins.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_prepare" hook for all plugins.
Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the project
Executing "before_plugin_add" hook for all plugins.
Calling plugman.fetch on plugin "cordova-plugin-whitelist@1.0.0"
Fetching plugin "cordova-plugin-whitelist@1.0.0" via npm
Copying plugin "/Users/dave/.npm/cordova-plugin-whitelist/1.0.0/package" => "/Users/dave/cordova-custom-config-example/plugins/cordova-plugin-whitelist"
Calling plugman.install on plugin "/Users/dave/cordova-custom-config-example/plugins/cordova-plugin-whitelist" for platform "android
Installing "cordova-plugin-whitelist" for android
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Executing "before_plugin_install" hook for "cordova-plugin-whitelist" on android.
Install start for "cordova-plugin-whitelist" on android.
Beginning processing of action stack for android project...
Action stack processing complete.
Install complete for cordova-plugin-whitelist on android.
Executing "after_plugin_install" hook for "cordova-plugin-whitelist" on android.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_add" hook for all plugins.
Discovered plugin "cordova-custom-config" in config.xml. Installing to the project
Executing "before_plugin_add" hook for all plugins.
Calling plugman.fetch on plugin "cordova-custom-config@1"
Fetching plugin "cordova-custom-config@1" via npm
Copying plugin "/Users/dave/.npm/cordova-custom-config/1.1.6/package" => "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config"
Calling plugman.install on plugin "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config" for platform "android
Installing "cordova-custom-config" for android
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Executing "before_plugin_install" hook for "cordova-custom-config" on android.
Install start for "cordova-custom-config" on android.
Beginning processing of action stack for android project...
Action stack processing complete.
Install complete for cordova-custom-config on android.
Executing "after_plugin_install" hook for "cordova-custom-config" on android.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_add" hook for all plugins.
saving android@4.1.1 into platforms.json
Executing "after_platform_add" hook for all plugins.
cordova-custom-config: All module dependencies are installed
Executing "before_prepare" hook for all plugins.
cordova-custom-config: Running restoreBackups.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_prepare" hook for all plugins.
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Can't find module fs-extra, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Can't find module lodash, running npm install
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Can't find module elementtree, running npm install
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "plist"
cordova-custom-config: Can't find module plist, running npm install
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Can't find module xcode, running npm install
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Can't find module tostr, running npm install
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Can't find module dummy, running npm install
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Created backup directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup
cordova-custom-config: Created backup platform directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android
cordova-custom-config: Backed up /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml to /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android/AndroidManifest.xml
cordova-custom-config: Applied custom config from config.xml to /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "plist"
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Checking to see if there are backups to restore...
cordova-custom-config: Restored backup of 'AndroidManifest.xml' to :/Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
Executing "before_plugin_rm" hook for all plugins.
Calling plugman.uninstall on plugin "cordova-custom-config" for platform "android"
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Executing "before_plugin_uninstall" hook for "cordova-custom-config" on android.
Uninstalling cordova-custom-config from android
Beginning processing of action stack for android project...
Action stack processing complete.
Removing "cordova-custom-config"
Deleted "cordova-custom-config"
Removing plugin cordova-custom-config from fetch.json
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_rm" hook for all plugins.
cordova-custom-config: There was an error reading the file: Error: ENOENT, open '/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/package.json'
Executing "before_plugin_add" hook for all plugins.
no version specified, retrieving version from config.xml
Calling plugman.fetch on plugin "cordova-custom-config@1"
Fetching plugin "cordova-custom-config@1" via npm
Copying plugin "/Users/dave/.npm/cordova-custom-config/1.1.6/package" => "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config"
Calling plugman.install on plugin "/Users/dave/cordova-custom-config-example/plugins/cordova-custom-config" for platform "android
Installing "cordova-custom-config" for android
Running command: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Command finished with error code 0: /Users/dave/cordova-custom-config-example/platforms/android/cordova/version
Executing "before_plugin_install" hook for "cordova-custom-config" on android.
Install start for "cordova-custom-config" on android.
Beginning processing of action stack for android project...
Action stack processing complete.
Install complete for cordova-custom-config on android.
Executing "after_plugin_install" hook for "cordova-custom-config" on android.
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_plugin_add" hook for all plugins.
cordova-custom-config: All module dependencies are installed
Executing "before_prepare" hook for all plugins.
cordova-custom-config: Running restoreBackups.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "Custom config plugin example"
This app does not have launcher icons defined
Wrote out Android package name to "uk.co.workingedge.phonegap.plugins.example.customconfig"
Executing "after_prepare" hook for all plugins.
cordova-custom-config: Running applyCustomConfig.js
cordova-custom-config: Running resolveDependencies.js
cordova-custom-config: Installing pre-requisite modules
cordova-custom-config: Installing "read-package-json"
cordova-custom-config: Can't find module read-package-json, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Can't find module fs-extra, running npm install
cordova-custom-config: Node module read-package-json is found
cordova-custom-config: Installed "read-package-json"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Can't find module lodash, running npm install
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Can't find module elementtree, running npm install
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "plist"
cordova-custom-config: Can't find module plist, running npm install
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Can't find module xcode, running npm install
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Can't find module tostr, running npm install
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Can't find module dummy, running npm install
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Created backup directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup
cordova-custom-config: Created backup platform directory: /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android
cordova-custom-config: Backed up /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml to /Users/dave/cordova-custom-config-example/plugins/cordova-custom-config/backup/android/AndroidManifest.xml
cordova-custom-config: Applied custom config from config.xml to /Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: Pre-requisite modules installed
cordova-custom-config: Installing "fs-extra"
cordova-custom-config: Node module fs-extra is found
cordova-custom-config: Installed "fs-extra"
cordova-custom-config: Installing "lodash"
cordova-custom-config: Node module lodash is found
cordova-custom-config: Installed "lodash"
cordova-custom-config: Installing "elementtree"
cordova-custom-config: Node module elementtree is found
cordova-custom-config: Installed "elementtree"
cordova-custom-config: Installing "plist"
cordova-custom-config: Node module plist is found
cordova-custom-config: Installed "plist"
cordova-custom-config: Installing "xcode"
cordova-custom-config: Node module xcode is found
cordova-custom-config: Installed "xcode"
cordova-custom-config: Installing "tostr"
cordova-custom-config: Node module tostr is found
cordova-custom-config: Installed "tostr"
cordova-custom-config: Installing "dummy"
cordova-custom-config: Node module dummy is found
cordova-custom-config: Installed "dummy"
cordova-custom-config: All module dependencies are installed
cordova-custom-config: Checking to see if there are backups to restore...
cordova-custom-config: Restored backup of 'AndroidManifest.xml' to :/Users/dave/cordova-custom-config-example/platforms/android/AndroidManifest.xml
Executing "before_platform_rm" hook for all plugins.
Removing android from platforms.json file ...
Executing "after_platform_rm" hook for all plugins.
Daves-Mac:cordova-custom-config-example dave$

Reply to this email directly or view it on GitHub.

@dpa99c
Copy link
Owner

dpa99c commented Nov 14, 2015

OK, I've managed to reproduce the error when removing the plugin from the project. Will try to find the cause and fix...

@dpa99c
Copy link
Owner

dpa99c commented Nov 14, 2015

Commit 499a1f6 fixes the issue caused by trying to resolve dependencies when the plugin is being removed. I'm going to push this out to npm as part of v1.1.7. Let me know if that fixes your issue or not.

@dpa99c dpa99c closed this as completed Nov 24, 2015
@nocodedweb
Copy link

Problem still exists in cordova-custom-config@3.1.2 ? Error when removing or compiling:
cordova-custom-config: Error loading dependencies (Cannot find module 'lodash') - attempting to resolve
Installing lodash doesn't seem to help either. Thoughts?

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

No branches or pull requests

3 participants