Cordova Android Clean Build
August 7, 2025 ยท AI Conversations
User
android cordova clean build
Assistant
To perform a **clean build** in an **Apache Cordova** Android project, follow these steps:
—
### ๐ **1. Clean the Cordova Android Platform**
cordova clean android
> This command removes the `platforms/android/build` directory and resets the build state.
If `cordova clean` isn't available in your version (older ones), you can manually do it:
rm -rf platforms/android/build
rm -rf platforms/android/app/build
—
### ๐งน **2. Optional: Remove `platforms` and `plugins` for a full clean**
This is more aggressive, useful for corrupted builds:
rm -rf platforms
rm -rf plugins
rm -rf node_modules
rm package-lock.json
npm install
cordova platform add android
cordova plugin add <plugins-you-need>
—
### โ๏ธ **3. Build Again**
cordova build android
—
### โ **Optional: Run in Device/Emulator**
cordova run android
—
### ๐จ Tips if You Face Issues
– Ensure `ANDROID_HOME` is properly set in your environment.
– If you're using Gradle directly, you can also try:
cd platforms/android
./gradlew clean
Let me know if you're using Android Studio or CLI only โ I can tailor the steps for that.