#!/bin/bash # Fix for capacitor.build.gradle in plugin development projects # This script should be run after any 'npx cap sync' or 'npx cap update' set -e CAPACITOR_BUILD_GRADLE="android/app/capacitor.build.gradle" if [ -f "$CAPACITOR_BUILD_GRADLE" ]; then echo "🔧 Fixing capacitor.build.gradle for plugin development project..." # Comment out the problematic line if it exists and isn't already commented if grep -q "^apply from: \"../capacitor-cordova-android-plugins/cordova.variables.gradle\"" "$CAPACITOR_BUILD_GRADLE"; then sed -i 's/^apply from: "\.\.\/capacitor-cordova-android-plugins\/cordova\.variables\.gradle"/\/\/ Plugin development project - no Capacitor integration files needed\n\/\/ &/' "$CAPACITOR_BUILD_GRADLE" echo "✅ Fixed capacitor.build.gradle" else echo "â„šī¸ capacitor.build.gradle already fixed or doesn't need fixing" fi else echo "âš ī¸ capacitor.build.gradle not found at $CAPACITOR_BUILD_GRADLE" fi