Remove js files before uninstalling the plugin
MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.3.6-ext-20180601-1831" 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.6-ext-20180604-1005" 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_rm.js
src/before_plugin_rm.js
@@ -23,6 +23,20 @@ module.exports = function(ctx) {
var xml2js = require('xml2js');
+ var rmdir = function(dir_path) {
+ if (fs.existsSync(dir_path)) {
+ fs.readdirSync(dir_path).forEach(function(entry) {
+ var entry_path = path.join(dir_path, entry);
+ if (fs.lstatSync(entry_path).isDirectory()) {
+ rmdir(entry_path);
+ } else {
+ fs.unlinkSync(entry_path);
+ }
+ });
+ fs.rmdirSync(dir_path);
+ }
+ };
+
return Q.Promise(function(resolve, reject, notify) {
//---------------------------
// Read the config.xml file
@@ -143,6 +157,15 @@ module.exports = function(ctx) {
}
});
});
+ })
+ .then(function() {
+ return Q.Promise(function(resolve, reject, notify) {
+ ctx.opts.cordova.platforms.forEach(function(platformName) {
+ rmdir(path.join(projectRoot, 'platforms', platformName, 'platform_www', 'plugins', 'cordova-plugin-googlemaps'));
+ rmdir(path.join(projectRoot, 'platforms', platformName, 'www', 'plugins', 'cordova-plugin-googlemaps'));
+ });
+ resolve();
+ });
});

Remove js files before uninstalling the plugin