function getUserTargetSdkVersion (projectRoot) {
    // If the repo config.xml file exists, find the desired targetSdkVersion.
    // We need to use the cordova project's config.xml here, since the platform
    // project's config.xml does not yet have the user's preferences when this
    // function is called during `Api.createPlatform`.
    const configFile = path.join(projectRoot, '../../config.xml');
    if (!fs.existsSync(configFile)) return 0;

    const configParser = new ConfigParser(configFile);
    const targetSdkVersion = parseInt(configParser.getPreference('android-targetSdkVersion', 'android'), 10);
    return isNaN(targetSdkVersion) ? 0 : targetSdkVersion;
}
@param {string} projectRoot
@returns {number} target sdk or 0 if undefined