npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-plugin-gradle-config-modifier

v1.0.0

Published

Cordova plugin to manipulate Android cdv-gradle-config.json safely

Readme

Cordova Plugin Gradle Config Modifier

This plugin allows you to dynamically modify the values inside the cdv-gradle-config.json file on the Android platform via the Cordova Command-Line Interface (CLI). It is highly useful for centrally managing SDK versions, Kotlin versions, or other Gradle configurations.

Key Features

  • Modifies Android Gradle build configurations using --variable flags.
  • Non-destructive by default: If you do not specify any variables during installation, your existing configurations remain completely untouched.
  • Automatically parses data types (converting CLI strings into JSON-compliant number, boolean, or null values).
  • Includes an internal blocklist to protect crucial built-in Cordova variables.

Installation

Safe Installation (No Overwrites)

Installing the plugin without any variables will securely preserve your existing cdv-gradle-config.json settings.

cordova plugin add cordova-plugin-gradle-config-modifier

Installation with Variable Overrides

Use the --variable flag to specifically target and overwrite configurations during installation:

cordova plugin add cordova-plugin-gradle-config-modifier \
  --variable KOTLIN_VERSION=2.1.21 \
  --variable MIN_SDK_VERSION=24 \
  --variable IS_GRADLE_PLUGIN_KOTLIN_ENABLED=true

Supported Variables

By default, all variables are set to a PRESERVE state, meaning they will not modify your project unless explicitly declared in the CLI. Below is the list of supported variables alongside standard Cordova default examples:

| Variable Name | Example Value | | :--- | :--- | | MIN_SDK_VERSION | 24 | | SDK_VERSION | 36 | | COMPILE_SDK_VERSION | null | | GRADLE_VERSION | 8.13 | | MIN_BUILD_TOOLS_VERSION | 35.0.0 | | AGP_VERSION | 8.7.3 | | KOTLIN_VERSION | 2.1.21 | | ANDROIDX_APP_COMPAT_VERSION | 1.7.0 | | ANDROIDX_WEBKIT_VERSION | 1.12.1 | | ANDROIDX_CORE_SPLASHSCREEN_VERSION | 1.0.1 | | GRADLE_PLUGIN_GOOGLE_SERVICES_VERSION | 4.4.2 | | IS_GRADLE_PLUGIN_GOOGLE_SERVICES_ENABLED | false | | IS_GRADLE_PLUGIN_KOTLIN_ENABLED | true | | JAVA_SOURCE_COMPATIBILITY | 11 | | JAVA_TARGET_COMPATIBILITY | 11 | | KOTLIN_JVM_TARGET | null |

System Exception: The PACKAGE_NAMESPACE variable is internally blocked and cannot be modified through this plugin. This is to prevent build conflicts, as Cordova automatically manages this namespace based on the app id defined in your config.xml file.

How It Works

This plugin registers a hook during the after_prepare lifecycle. When you run cordova prepare android or cordova build android, the script runs in the background, reads your preference configurations from android.json, and safely overwrites the targeted properties in platforms/android/cdv-gradle-config.json before the compilation process begins. Any variables you did not explicitly set will be ignored, leaving your original project configurations intact.

Uninstallation

To remove the plugin from your project:

cordova plugin rm cordova-plugin-gradle-config-modifier

License

MIT License