Registry / devops / cordova-androidx-build

cordova-androidx-build

JSON →
library1.0.4jsnpmunverified

The `cordova-androidx-build` plugin (current stable version 1.0.4) automatically migrates Cordova project code between Android Support Libraries and AndroidX libraries during the build process. This plugin is crucial for maintaining compatibility across different `cordova-android` versions, especially those transitioning to or already using AndroidX (e.g., `cordova-android@9` and newer). A key differentiator is its use of Gradle scripts, enabling it to work reliably on both local development machines and cloud build services like PhoneGap Build, which is not possible with hook-script-based alternatives such as `cordova-plugin-androidx-adapter`. It provides bidirectional migration capabilities, ensuring plugins build correctly whether the target project uses older Support Libraries or the newer AndroidX ecosystem. Release cadence is typically on an as-needed basis to address compatibility issues or updates in the Android build ecosystem.

npm install cordova-androidx-build
INSTALL
IMPORT
SIG · CORDOVA-ANDROIDX-B
C
cordova-androidx-build
devopsjavascriptv1.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Demonstrates how to install the plugin directly or declare it as a dependency for another Cordova plugin, and then build the Android project.

cordova plugin add cordova-androidx-build # Or, integrate as a dependency in your plugin.xml for other plugins: # (This allows your plugin to ensure the project is correctly configured for AndroidX) # <?xml version='1.0' encoding='utf-8'?> # <plugin id="my-awesome-plugin" version="1.0.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"> # <name>My Awesome Plugin</name> # <platform name="android"> # <dependency id="cordova-androidx-build" /> # <!-- Your plugin's Android specific source files and configurations --> # </platform> # </plugin> # After adding, simply build your Cordova project as usual: cordova build android
Debug
Known issues
gotchaUsing `cordova-androidx-build` alongside `cordova-plugin-androidx-adapter` can lead to unpredictable build behavior and conflicts, as both aim to perform similar migration tasks but use different mechanisms. It's recommended to choose one based on your project requirements, especially regarding cloud build service compatibility.
fix
Remove `cordova-plugin-androidx-adapter` if `cordova-androidx-build` is installed, or vice-versa. Prefer `cordova-androidx-build` for cloud build environments.
affects: >=1.0.0
gotchaThis plugin operates during the Gradle sync/build process, not during `cordova prepare`. This means that some AndroidX/Support Library conversion issues might only become apparent later in the build cycle compared to hook-script-based solutions.
fix
Be aware that build logs will show the migration activity during Gradle execution. If you encounter issues, review Gradle output carefully.
affects: >=1.0.0
breakingWhile designed for compatibility, very old `cordova-android` versions (e.g., pre-8.x) may still exhibit issues when attempting to integrate with plugins requiring AndroidX, even with this plugin. The transition to AndroidX is best handled with `cordova-android@8.x` or newer.
fix
Ensure your `cordova-android` platform version is at least 8.x, ideally 9.x or later, for robust AndroidX compatibility.
affects: <=0.9.x
Errors
Common errors & fixes
Manifest merger failed : Attribute application@appComponentFactory value=(...) from [...] AndroidManifest.xml:22:18-91 is also present at [...] AndroidManifest.xml:24:18-91 value=(...). Suggest: don't use tools:replace on <application> element with android:appComponentFactory yet; see https://issuetracker.google.com/issues/116239167
Conflicting AndroidX and Support Library declarations in `AndroidManifest.xml`, often due to mixing components that expect different library versions.
fix
This plugin is designed to mitigate such issues. If this error persists, ensure all other plugins are AndroidX compatible or that `cordova-androidx-build` is correctly installed and integrated. You may need to manually inspect your project's `AndroidManifest.xml` files for conflicting entries or check individual plugin dependencies.
AAPT: error: resource android:attr/fontVariationSettings not found.
This error typically indicates that an older `compileSdkVersion` or `targetSdkVersion` is being used with a newer AndroidX library component that requires a higher API level, or a mix of old/new build tools.
fix
Ensure your `platforms/android/gradle.properties` file or `build.gradle` defines `compileSdkVersion` and `targetSdkVersion` appropriately for your AndroidX dependencies (e.g., API 28 or higher for many AndroidX features). This plugin helps with package migration, but version targets must still be correct.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Resources
cordova-androidx-build — npm install cordova-androidx-build · libregistry