Open p-v-d-Veeken opened 3 years ago
For anyone having the same problem, the following hack solved it for me:
"scripts": {
"postinstall": "npx ts-node scripts/setGoogleAnalyticsVersion.ts"
}
import * as fs from 'fs';
const GMS_VERSION = '17.0.0'; const PLUGIN_PATH = './node_modules/cordova-plugin-google-analytics/plugin.xml';
console.log(Attempting to set $GMS_VERSION = ${GMS_VERSION} in ${PLUGIN_PATH}
);
const pluginContents = fs.readFileSync(PLUGIN_PATH).toString('utf8'); const pluginContentsUpdated = pluginContents.replace('$GMS_VERSION', GMS_VERSION);
fs.writeFileSync(PLUGIN_PATH, pluginContentsUpdated);
console.log('Success!');
No doubt there are better ways to achieve the same thing, but at least it works.
PR are welcome
In the documentation it says: _Use the GMSVERSION to align the required play-services version with other plugins.
However I'm working on a capacitor project and although it was fairly painless to install the plugin, I'm now having issues building the app due to version mismatches:
It appears this problem could be trivially fixed by specifying the
GMS_VERSION
, but I don't know if that's possible with capacitor. Any help would be greatly appreciated. :)