Icety commented on issue #640: cordova-plugin-browsertab conflict with cordova [email protected] and 7.1.4 URL: https://github.com/apache/cordova-android/issues/640#issuecomment-463568461 When you need the fix to be applied automatically the following hook will fix it for you: Add to config.xml: ``` <platform name="android"> <hook src="scripts/afterAddBrowserTabPlugin.js" type="after_plugin_add" /> </platform> ``` create file: cordova/scripts/afterAddBrowserTabPlugin.js ```nodejs const fs = require('fs'); module.exports = function(ctx) { var Q = ctx.requireCordovaModule('q'); var deferral = new Q.defer(); if (ctx.opts.plugins.includes('cordova-plugin-browsertab')) { let file = ctx.opts.projectRoot + '/plugins/cordova-plugin-browsertab/src/android/BrowserTab.gradle'; console.log(file); checkForFix(file); } return deferral.promise; }; function checkForFix(file) { fs.readFile(file, function read(err, data) { if (err) { throw err; } if (!data.includes('minSdkFix')) { writeFix(file); } }); } function writeFix(file) { fs.appendFile(file, '\n\n// minSdkFix\nminSdkVersion = 21;\ncdvMinSdkVersion = minSdkVersion;\n' + 'ext.cdvMinSdkVersion = minSdkVersion;', function(err) { if (err) { console.log('Adding minSdkFix failed: ' + err); } console.log("Writing success!"); }); } ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
