dpa99c / cordova-custom-config

Cordova/Phonegap plugin to update platform configuration files based on preferences and config-file data defined in config.xml
317 stars 85 forks source link

cordova prepare not working properly with this plugin #130

Closed sinedied closed 6 years ago

sinedied commented 6 years ago

Whatever I try, I still have issue with cordova prepare and this plugin.

I'm using latest cordova@7 version with node@8 and npm@5, and cordova fetch is enabled (running on OSX).

I have this error every time:

cordova-custom-config: Running applyCustomConfig.js
Error: Cannot read property 'getConfigXml' of undefined

If I try to run cordova prepare again:

Error: Error loading dependencies - ensure the plugin has been installed via cordova-fetch or run 'npm install cordova-custom-config': Cannot find module 'tostr'

If I remove this plugin, cordova prepare works perfectly, and installing it after with cordova plugin add cordova-custom-config works without issue.

Seems that cordova prepare does something your plugin do not seems to like πŸ˜•

To reproduce it:

  1. clone this repo: https://github.com/ngx-rocket/starter-kit
  2. change to cordova/ionic branch: git checkout cordova/ionic
  3. npm install
  4. npm run cordova:prepare (build app then run cordova prepare using local cordova dependency)
dpa99c commented 6 years ago

I ran the exact commands above and the prepare operation worked fine and without errors (see console output below).

The errors you describe indicate the plugin's hook script is for some reason having problems resolving its node module dependencies:

Error: Cannot read property 'getConfigXml' of undefined

This will be generated from this line because require() has failed to resolve the fileUtils module here.

Error: Error loading dependencies - ensure the plugin has been installed via cordova-fetch or run 'npm install cordova-custom-config': Cannot find module 'tostr'

This is thrown by the hook script because it threw an exception while loading dependencies because the tostr module couldn't be found.

I'm not sure why the node dependency resolution is failing in your enviroment and not mine. The most likely cause I can think of is an upstream node error which is causing cordova-fetch to fail to resolve the plugin dependencies.

You could try changing your node version e.g. to node@6. I'm using nvm to manage mine on OSX, so it's easy to switch. I tested your steps with node@6.11.0/npm@3.10.10 and the prepare operation worked fine also.

console output ``` $ sw_vers ProductName: Mac OS X ProductVersion: 10.13.1 BuildVersion: 17B48 $ node -v v8.9.1 $ npm -v 5.5.1 $ cordova -v 7.0.1 $ git clone https://github.com/ngx-rocket/starter-kit Cloning into 'starter-kit'... remote: Counting objects: 1783, done. remote: Compressing objects: 100% (46/46), done. remote: Total 1783 (delta 18), reused 23 (delta 8), pack-reused 1729 Receiving objects: 100% (1783/1783), 542.93 KiB | 703.00 KiB/s, done. Resolving deltas: 100% (1168/1168), done. $ cd starter-kit/ DavesMaDesktop2:starter-kit dave$ git checkout cordova/ionic Branch cordova/ionic set up to track remote branch cordova/ionic from origin. Switched to a new branch 'cordova/ionic' DavesMaDesktop2:starter-kit dave$ npm install npm WARN deprecated chalk@2.0.1: Please upgrade to Chalk 2.1.0 - template literals in this version (2.0.1) are quite buggy. npm WARN deprecated node-uuid@1.4.8: Use uuid module instead npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue > fsevents@1.1.3 install /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/fsevents > node install [fsevents] Success: "/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile > node-sass@4.7.1 install /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/node-sass > node scripts/install.js Cached binary found at /Users/dave/.npm/node-sass/4.7.1/darwin-x64-57_binding.node > puppeteer@0.12.0 install /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/puppeteer > node install.js Downloading Chromium r508693 - 72.6 Mb [====================] 100% 0.0s Chromium downloaded to /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/puppeteer/.local-chromium/mac-508693 > uglifyjs-webpack-plugin@0.4.6 postinstall /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/node_modules/uglifyjs-webpack-plugin > node lib/post_install.js > node-sass@4.7.1 postinstall /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/node-sass > node scripts/build.js Binary found at /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/node-sass/vendor/darwin-x64-57/binding.node Testing binary Binary is fine > ng-x-rocket@1.0.0 prepare /Users/dave/Documents/projects/@scratch/starter-kit > ngx-scripts unpin-ionic-dependencies npm notice created a lockfile as package-lock.json. You should commit this file. added 1786 packages in 127.172s DavesMaDesktop2:starter-kit dave$ DavesMaDesktop2:starter-kit dave$ npm run cordova:prepare > ng-x-rocket@1.0.0 cordova:prepare /Users/dave/Documents/projects/@scratch/starter-kit > ngx-scripts cordova prepare Date: 2017-11-20T12:52:50.639Z Hash: 56324b49ff0138e87be7 Time: 265319ms chunk {0} polyfills.dea57e1b70150f20917c.bundle.js (polyfills) 96 kB [initial] [rendered] chunk {1} main.dd654f87a714770ae0c9.bundle.js (main) 976 kB [initial] [rendered] chunk {2} styles.d7e1e35a2f0ea5a0121a.bundle.css (styles) 434 kB [initial] [rendered] chunk {3} inline.7afe5beb359ec8c39b67.bundle.js (inline) 1.45 kB [entry] [rendered] WARNING in ./node_modules/ionic-angular/util/ng-module-loader.js 20:11-36 Critical dependency: the request of a dependency is an expression at ImportLazyContextDependency.getWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/dependencies/ContextDependency.js:39:18) at Compilation.reportDependencyErrorsAndWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:703:24) at Compilation.finish (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:561:9) at applyPluginsParallel.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compiler.js:506:17) at /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/tapable/lib/Tapable.js:289:11 at _addModuleChain (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:507:11) at processModuleDependencies.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:477:14) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) @ ./node_modules/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @ ./src/main.ts @ multi ./src/main.ts WARNING in ./node_modules/ionic-angular/util/ng-module-loader.js 30:11-36 Critical dependency: the request of a dependency is an expression at ImportLazyContextDependency.getWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/dependencies/ContextDependency.js:39:18) at Compilation.reportDependencyErrorsAndWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:703:24) at Compilation.finish (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:561:9) at applyPluginsParallel.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compiler.js:506:17) at /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/tapable/lib/Tapable.js:289:11 at _addModuleChain (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:507:11) at processModuleDependencies.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:477:14) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) @ ./node_modules/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @ ./src/main.ts @ multi ./src/main.ts Discovered platform "android@^6.2.3" in config.xml or package.json. Adding it to the project Using cordova-fetch for cordova-android@^6.2.3 Adding android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.company.app Name: ngX_Rocket Activity: MainActivity Android target: android-26 Subproject Path: CordovaLib Android project created with cordova-android@6.4.0 Discovered platform "ios@^4.4.0" in config.xml or package.json. Adding it to the project Using cordova-fetch for cordova-ios@^4.4.0 Adding ios project... Creating Cordova project for the iOS platform: Path: platforms/ios Package: com.company.app Name: ngX-Rocket iOS project created with cordova-ios@4.5.3 Discovered plugin "cordova-custom-config" in config.xml. Adding it to the project Installing "cordova-custom-config" for android Installing "cordova-custom-config" for ios Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project Installing "cordova-plugin-device" for android Installing "cordova-plugin-device" for ios Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project Installing "cordova-plugin-splashscreen" for android Installing "cordova-plugin-splashscreen" for ios Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project Installing "cordova-plugin-statusbar" for android Installing "cordova-plugin-statusbar" for ios Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project Installing "cordova-plugin-whitelist" for android This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in. Installing "cordova-plugin-whitelist" for ios Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project Installing "ionic-plugin-keyboard" for android Installing "ionic-plugin-keyboard" for ios Discovered plugin "cordova-plugin-wkwebview-engine" in config.xml. Adding it to the project Installing "cordova-plugin-wkwebview-engine" for android Installing "cordova-plugin-wkwebview-engine" for ios cordova-custom-config: Applied custom config from config.xml to /Users/dave/Documents/projects/@scratch/starter-kit/platforms/android/AndroidManifest.xml cordova-custom-config: Applied custom config from config.xml to /Users/dave/Documents/projects/@scratch/starter-kit/platforms/ios/ngX-Rocket/ngX-Rocket-Info.plist $ more /Users/dave/Documents/projects/@scratch/starter-kit/platforms/android/AndroidManifest.xml $ more /Users/dave/Documents/projects/@scratch/starter-kit/platforms/ios/ngX-Rocket/ngX-Rocket-Info.plist CFBundleDevelopmentRegion English CFBundleDisplayName ngX-Rocket CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIcons CFBundleIcons~ipad CFBundleIdentifier com.company.app CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleShortVersionString 1.0.0 CFBundleSignature ???? CFBundleVersion 1.0.0 LSRequiresIPhoneOS NSMainNibFile NSMainNibFile~ipad UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIRequiresFullScreen NSAppTransportSecurity NSExceptionDomains localhost NSExceptionAllowsInsecureHTTPLoads NSAllowsArbitraryLoads UIInterfaceOrientation UIInterfaceOrientationPortrait UILaunchStoryboardName CDVLaunchScreen UIStatusBarStyle UIStatusBarStyleLightContent $ ```
sinedied commented 6 years ago

I just missed a change I made in the meantime to fix this issue, that is not present in this repo: I added npm@5 as a local dependency, because cordova-lib use an outdated npm@2 to fetch dependencies and it fails because of issue with peerDependencies 😭

Without this it works as you tested, but the initial issue is still present 😞 Anyway this has more to do with the way cordova retrieve its dependencies that your lib, the error coming from your code was just a side effect.

If anyone comes to this, its seems that using npm@3 instead of npm@5 as a local dependency seems to work around both issues 🀣

Sorry for the noise and thanks for taking the time to test on your side!

sinedied commented 6 years ago

Again, the dependencies issue popped up back again with cordova@8, as the npm local dependency is no longer needed. πŸ˜•

Running cordova prepare ends up with this error:

(node:77707) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): cordova-custom-config: Error loading dependencies for applyCustomConfig.js - ensure the plugin has been installed via cordova-fetch or run 'npm install cordova-custom-config': Cannot find module 'tostr'
dpa99c commented 6 years ago

No problem in my build env with cordova@8, see console output below:

console output ``` DavesMacDesktop:@scratch dave$ sw_vers ProductName: Mac OS X ProductVersion: 10.13.2 BuildVersion: 17C205 DavesMacDesktop:@scratch dave$ node -v v8.9.1 DavesMacDesktop:@scratch dave$ npm -v 5.5.1 DavesMacDesktop:@scratch dave$ cordova -v 8.0.0 DavesMacDesktop:@scratch dave$ git clone https://github.com/ngx-rocket/starter-kit && cd starter-kit Cloning into 'starter-kit'... remote: Counting objects: 1769, done. remote: Total 1769 (delta 0), reused 0 (delta 0), pack-reused 1769 Receiving objects: 100% (1769/1769), 535.95 KiB | 1.20 MiB/s, done. Resolving deltas: 100% (1171/1171), done. DavesMacDesktop:starter-kit dave$ git checkout cordova/ionic Branch cordova/ionic set up to track remote branch cordova/ionic from origin. Switched to a new branch 'cordova/ionic' DavesMacDesktop:starter-kit dave$ npm install npm WARN deprecated chalk@2.0.1: Please upgrade to Chalk 2.1.0 - template literals in this version (2.0.1) are quite buggy. npm WARN deprecated node-uuid@1.4.8: Use uuid module instead npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue > fsevents@1.1.3 install /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/fsevents > node install [fsevents] Success: "/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile > node-sass@4.7.2 install /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.7.2/darwin-x64-57_binding.node Download complete βΈ© β ‹ : Binary saved to /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/node-sass/vendor/darwin-x64-57/binding.node Caching binary to /Users/dave/.npm/node-sass/4.7.2/darwin-x64-57_binding.node > puppeteer@0.13.0 install /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/puppeteer > node install.js Downloading Chromium r515411 - 73.2 Mb [====================] 100% 0.0s Chromium downloaded to /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/puppeteer/.local-chromium/mac-515411 > uglifyjs-webpack-plugin@0.4.6 postinstall /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/node_modules/uglifyjs-webpack-plugin > node lib/post_install.js > node-sass@4.7.2 postinstall /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/node-sass > node scripts/build.js Binary found at /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/node-sass/vendor/darwin-x64-57/binding.node Testing binary Binary is fine > ng-x-rocket@1.0.0 prepare /Users/dave/Documents/projects/@scratch/starter-kit > ngx-scripts unpin-ionic-dependencies npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN @schematics/schematics@0.0.15 requires a peer of rxjs@^5.5.6 but none is installed. You must install peer dependencies yourself. npm WARN postcss-html@0.11.0 requires a peer of postcss-sass@>=0.2.0 but none is installed. You must install peer dependencies yourself. added 2125 packages in 125.144s DavesMacDesktop:starter-kit dave$ npm run cordova:prepare > ng-x-rocket@1.0.0 cordova:prepare /Users/dave/Documents/projects/@scratch/starter-kit > ngx-scripts cordova prepare 69% building modules 716/717 modules 1 active ...ts/@scratch/starter-kit/src/main.scssNode#moveTo was deprecated. Use Container#append. Date: 2018-01-22T16:40:44.479Z Hash: f4b4f6fa8e5ebd757baf Time: 151238ms chunk {0} polyfills.6d2c524f31adf3be270e.bundle.js (polyfills) 94.6 kB [initial] [rendered] chunk {1} main.03466058a00cb4236530.bundle.js (main) 1 MB [initial] [rendered] chunk {2} styles.d7e1e35a2f0ea5a0121a.bundle.css (styles) 434 kB [initial] [rendered] chunk {3} inline.b4cf6c16d1e474ac7a2d.bundle.js (inline) 1.45 kB [entry] [rendered] WARNING in ./node_modules/ionic-angular/util/ng-module-loader.js 20:11-36 Critical dependency: the request of a dependency is an expression at ImportLazyContextDependency.getWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/dependencies/ContextDependency.js:39:18) at Compilation.reportDependencyErrorsAndWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:703:24) at Compilation.finish (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:561:9) at applyPluginsParallel.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compiler.js:506:17) at /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/tapable/lib/Tapable.js:289:11 at _addModuleChain (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:507:11) at processModuleDependencies.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:477:14) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) @ ./node_modules/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @ ./src/main.ts @ multi ./src/main.ts WARNING in ./node_modules/ionic-angular/util/ng-module-loader.js 30:11-36 Critical dependency: the request of a dependency is an expression at ImportLazyContextDependency.getWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/dependencies/ContextDependency.js:39:18) at Compilation.reportDependencyErrorsAndWarnings (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:703:24) at Compilation.finish (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:561:9) at applyPluginsParallel.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compiler.js:506:17) at /Users/dave/Documents/projects/@scratch/starter-kit/node_modules/tapable/lib/Tapable.js:289:11 at _addModuleChain (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:507:11) at processModuleDependencies.err (/Users/dave/Documents/projects/@scratch/starter-kit/node_modules/webpack/lib/Compilation.js:477:14) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) @ ./node_modules/ionic-angular/util/ng-module-loader.js @ ./src/app/app.module.ngfactory.js @ ./src/main.ts @ multi ./src/main.ts Discovered platform "android@^6.4.0" in config.xml or package.json. Adding it to the project Using cordova-fetch for cordova-android@^6.4.0 Adding android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.company.app Name: ngX_Rocket Activity: MainActivity Android target: android-26 Subproject Path: CordovaLib Android project created with cordova-android@6.4.0 Discovered platform "ios@^4.5.3" in config.xml or package.json. Adding it to the project Using cordova-fetch for cordova-ios@^4.5.3 Adding ios project... Creating Cordova project for the iOS platform: Path: platforms/ios Package: com.company.app Name: ngX-Rocket iOS project created with cordova-ios@4.5.4 Discovered plugin "cordova-custom-config" in config.xml. Adding it to the project Installing "cordova-custom-config" for android Installing "cordova-custom-config" for ios Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project Installing "cordova-plugin-device" for android Installing "cordova-plugin-device" for ios Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project Installing "cordova-plugin-splashscreen" for android Installing "cordova-plugin-splashscreen" for ios Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project Installing "cordova-plugin-statusbar" for android Installing "cordova-plugin-statusbar" for ios Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project Installing "cordova-plugin-whitelist" for android This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in. Installing "cordova-plugin-whitelist" for ios Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project Installing "ionic-plugin-keyboard" for android Installing "ionic-plugin-keyboard" for ios Discovered plugin "cordova-plugin-ionic-webview" in config.xml. Adding it to the project Installing "cordova-plugin-ionic-webview" for android Installing "cordova-plugin-ionic-webview" for ios cordova-custom-config: Applied custom config from config.xml to /Users/dave/Documents/projects/@scratch/starter-kit/platforms/android/AndroidManifest.xml cordova-custom-config: Applied custom config from config.xml to /Users/dave/Documents/projects/@scratch/starter-kit/platforms/ios/ngX-Rocket/ngX-Rocket-Info.plist DavesMacDesktop:starter-kit dave$ ```
sinedied commented 6 years ago

@dpa99c The repo has still not been updated and use a local cordova@7 version, which does not have the issue.

The problem is that when using cordova prepare with cordova@8, it fails installing plugins' npm dependencies correctly if they are not properly specified in your package.json.

With cordova@7 cordova prepare updated package.json if the entries were not present, but that's not the case anymore with cordova@8 (not sure if it's a bug or by design...). The workaround I found is to run prepare with cordova@7 to update the package.json file, then update to cordova@8 and now the error is not there (obviously) since your plugin package is properly installed by npm with npm install even before running cordova prepare.

I'm not sure what to think of this, but at least it works πŸ˜•

dpa99c commented 6 years ago

OK, but here's a different example which doesn't use a local Cordova version, so definitely using cordova@8 and that also works fine. Please give this one a try:

console output ``` DavesMacDesktop:@scratch dave$ git clone https://github.com/dpa99c/cordova-custom-config-example && cd cordova-custom-config-example Cloning into 'cordova-custom-config-example'... remote: Counting objects: 612, done. remote: Total 612 (delta 0), reused 0 (delta 0), pack-reused 612 Receiving objects: 100% (612/612), 3.85 MiB | 1.90 MiB/s, done. Resolving deltas: 100% (260/260), done. DavesMacDesktop:cordova-custom-config-example dave$ cordova -v 8.0.0 DavesMacDesktop:cordova-custom-config-example dave$ cordova platform add android Using cordova-fetch for cordova-android@^7.0.0 Adding android project... 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-26 Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.0.0 Android Studio project detected Android Studio project detected Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project Installing "cordova-plugin-whitelist" for android Adding cordova-plugin-whitelist to package.json Saved plugin info for "cordova-plugin-whitelist" to config.xml Discovered plugin "cordova-custom-config" in config.xml. Adding it to the project Installing "cordova-custom-config" for android Adding cordova-custom-config to package.json Saved plugin info for "cordova-custom-config" to config.xml cordova-custom-config: Applied custom config from config.xml to /Users/dave/Documents/projects/@scratch/cordova-custom-config-example/platforms/android/app/src/main/AndroidManifest.xml --save flag or autosave detected Saving android@~7.0.0 into config.xml file ... DavesMacDesktop:cordova-custom-config-example dave$ cd .. DavesMacDesktop:@scratch dave$ rm -Rf cordova-custom-config-example/ DavesMacDesktop:@scratch dave$ git clone https://github.com/dpa99c/cordova-custom-config-example && cd cordova-custom-config-example Cloning into 'cordova-custom-config-example'... remote: Counting objects: 612, done. remote: Total 612 (delta 0), reused 0 (delta 0), pack-reused 612 Receiving objects: 100% (612/612), 3.85 MiB | 2.04 MiB/s, done. Resolving deltas: 100% (260/260), done. DavesMacDesktop:cordova-custom-config-example dave$ cordova platform add android@6 Using cordova-fetch for cordova-android@6 Adding android project... 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-26 Subproject Path: CordovaLib Android project created with cordova-android@6.4.0 Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project Installing "cordova-plugin-whitelist" for android Adding cordova-plugin-whitelist to package.json Saved plugin info for "cordova-plugin-whitelist" to config.xml Discovered plugin "cordova-custom-config" in config.xml. Adding it to the project Installing "cordova-custom-config" for android Adding cordova-custom-config to package.json Saved plugin info for "cordova-custom-config" to config.xml cordova-custom-config: Applied custom config from config.xml to /Users/dave/Documents/projects/@scratch/cordova-custom-config-example/platforms/android/AndroidManifest.xml --save flag or autosave detected Saving android@~6.4.0 into config.xml file ... DavesMacDesktop:cordova-custom-config-example dave$ ```