Files
daily-notification-plugin/test-apps/daily-notification-test/docs/BUILD_QUICK_REFERENCE.md
2025-10-31 09:56:23 +00:00

94 lines
2.7 KiB
Markdown

# Build Process Quick Reference
**Author**: Matthew Raymer
**Date**: October 17, 2025
## 🚨 Critical Build Steps
```bash
# 1. Build web assets
npm run build
# 2. Sync with native projects (automatically fixes plugin paths)
npm run cap:sync
# 3. Build and deploy Android
cd android
./gradlew :app:assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
```
## ⚠️ Why `npm run cap:sync` is Important
**Problem**: `npx cap sync` overwrites `capacitor.plugins.json` and `capacitor.settings.gradle` with incorrect paths.
**Solution**: The `cap:sync` script automatically:
1. Runs `npx cap sync android`
2. Fixes `capacitor.settings.gradle` (corrects plugin path from `android/` to `android/plugin/`)
3. Restores the DailyNotification plugin entry in `capacitor.plugins.json`
**Without the fix**: Plugin detection fails, build errors occur, "simplified dialog" appears.
## 🔍 Verification Checklist
After build, verify:
- [ ] `capacitor.plugins.json` contains DailyNotification entry
- [ ] System Status shows "Plugin: Available" (green)
- [ ] Plugin Diagnostics shows all 4 plugins
- [ ] Click events work on ActionCard components
- [ ] No "simplified dialog" appears
## 🛠️ Automated Build Script
Create `scripts/build-and-deploy.sh`:
```bash
#!/bin/bash
set -e
echo "🔨 Building web assets..."
npm run build
echo "🔄 Syncing with native projects..."
npm run cap:sync
# This automatically syncs and fixes plugin paths
echo "🏗️ Building Android app..."
cd android
./gradlew :app:assembleDebug
echo "📱 Installing and launching..."
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n com.timesafari.dailynotification.test/.MainActivity
echo "✅ Build and deploy complete!"
```
## 🐛 Common Issues
| Issue | Symptom | Solution |
|-------|---------|----------|
| Empty plugin registry | `capacitor.plugins.json` is `[]` | Run `npm run cap:sync` or `node scripts/fix-capacitor-plugins.js` |
| Plugin not detected | "Plugin: Not Available" (red) | Check plugin registry, rebuild |
| Click events not working | Buttons don't respond | Check Vue 3 compatibility, router config |
| Inconsistent status | Different status in different cards | Use consistent detection logic |
## 📱 Testing Commands
```bash
# Check plugin registry
cat android/app/src/main/assets/capacitor.plugins.json
# Monitor native logs
adb logcat | grep -i "dailynotification\|capacitor\|plugin"
# Check app installation
adb shell pm list packages | grep dailynotification
```
---
**Remember**: Use `npm run cap:sync` instead of `npx cap sync android` directly - it automatically fixes the configuration files!