[ 
https://issues.apache.org/jira/browse/CB-11645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15400220#comment-15400220
 ] 

ASF GitHub Bot commented on CB-11645:
-------------------------------------

GitHub user riknoll opened a pull request:

    https://github.com/apache/cordova-lib/pull/472

    CB-11645: Check for getEditConfigs before invoking it on pluginInfo

    Adding a guard to prevent a type error when platforms and CLI have 
mismatching cordova-common versions. The issue here is that the `PluginInfo` 
object crosses the platform API barrier between the two so when 
5fb8dffb2dc92e4d08d286432f23299da0e812 added `getEditConfigs`, it ended up 
being a breaking change. This just checks for the function and ignores 
`edit-config` changes if it is not defined. More permanent fix might be to move 
its functionality elsewhere so that it does not cross the platform API barrier. 
Plugins that rely on `edit-config` (which should be none at this point) should 
[specify the platform and cordova cli version they 
need](http://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html#specifying-cordova-dependencies)
 in package.json.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/riknoll/cordova-lib edit-config-fix

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/472.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #472
    
----
commit 72074609c931177db9810723b4ee3425cf9e6b58
Author: Richard Knoll <rikn...@microsoft.com>
Date:   2016-07-29T23:19:11Z

    CB-11645: Check for getEditConfigs before invoking it on pluginInfo

----


> cordova-android@5.2.2 doesn't install plugins on <= cordova@6.3.0
> -----------------------------------------------------------------
>
>                 Key: CB-11645
>                 URL: https://issues.apache.org/jira/browse/CB-11645
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: CordovaCommon
>            Reporter: Steve Gill
>
> Trying to add cordova-android@5.2.2 or master using cordova@6.2.0 will give 
> the following error when installing the whitelist plugin
> `Failed to install 'cordova-plugin-whitelist':TypeError: 
> pluginInfo.getEditConfigs is not a function
>     at PlatformMunger.add_plugin_changes 
> (/Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js:134:42)
>     at 
> /Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/cordova-common/src/PluginManager.js:126:25
>     at _fulfilled 
> (/Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/q/q.js:834:54)
>     at self.promiseDispatch.done 
> (/Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/q/q.js:863:30)
>     at Promise.promise.promiseDispatch 
> (/Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/q/q.js:796:13)
>     at 
> /Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/q/q.js:857:14
>     at runSingle 
> (/Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/q/q.js:137:13)
>     at flush 
> (/Users/steveng/repo/cordova/tests/myapp/platforms/android/cordova/node_modules/q/q.js:125:13)
>     at _combinedTickCallback (internal/process/next_tick.js:67:7)
>     at process._tickCallback (internal/process/next_tick.js:98:9)
> Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You 
> might need to try adding it again. Error: TypeError: 
> pluginInfo.getEditConfigs is not a function```



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to