It could be because of multiple reasons, check against all below points and hopefully will work.
• Check values.xml for bad characters or invalid resource names
• Ensure AndroidManifest.xml and capacitor.config.json have a valid package ID (no :)
• Remove plugins one by one and rebuild (especially OCR, preview, or file-related ones)
• Fully clean and rebuild the project
• Use --verbose to capture the plugin or file causing the issue