Fix: before_plugin_install.js does not work properly.
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.3.5-beta-20180529-1043" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.3.5-beta-20180529-1113" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="BaseClass" src="www/BaseClass.js">
<runs />

MODIFY
src/before_plugin_install.js
src/before_plugin_install.js
@@ -26,15 +26,17 @@ module.exports = function(ctx) {
return Q.Promise(function(resolve, reject, notify) {
var exec = require('child_process').exec;
- exec('npm install xml2js minimist --save', function(err, stdout, stderr) {
- if (err || stderr) {
- reject(err || stderr);
+ exec('npm install xml2js minimist --save 2>&1', function(err, stdout) {
+ if (err) {
+ reject(err);
} else {
- resolve(data);
+ console.log(stdout);
+ resolve();
}
});
})
- .then(function(resolve, reject, notify) {
+ .then(function() {
+ return Q.Promise(function(resolve, reject, notify) {
if (fs.existsSync(pluginXmlPath + '.original')) {
// Copy the original plugin.xml to the current plugin.xml
return fs.createReadStream(pluginXmlPath + '.original')
@@ -48,6 +50,7 @@ module.exports = function(ctx) {
.on("error", reject)
.on("close", resolve);
}
+ });
})
.then(function() {
return Q.Promise(function(resolve, reject, notify) {

Fix: before_plugin_install.js does not work properly.