---
title: Troubleshooting Native Builds
description: Fix common native build errors in Capawesome Cloud — Java version, out-of-memory, and signing issues — or get an instant AI diagnosis with Ask AI.
---

# Troubleshooting

## First, try Ask AI

On any failed build, click **Ask AI** in the Console to get a one-click diagnosis — the likely cause, an explanation, and a suggested fix — without leaving the dashboard. It's the fastest way to understand a failure, and it's included free in every plan with build minutes. See [Cloud Assist → Ask AI](../assist/ask-ai.md).

If you'd rather diagnose manually, match your error below.

## Error `invalid source release: 21`

The wrong Java version is being used. See [Override Java Version on Android Builds](override-java-version.md) to set the `JAVA_VERSION` [environment variable](environment-variables.md#reserved-variables) to a supported major version such as `17` or `21`. For Capacitor 7, Java 21 is the default.

## Error `JavaScript heap out of memory`

Node.js ran out of memory during the web build. The default heap limit is ~2 GB, which may not be enough for large projects. Add `NODE_OPTIONS` as an [environment variable](environments.md) with the value `--max-old-space-size=4096` (4 GB); use `8192` if that's still not enough.

Alternatively, set it directly in your build script:

```json
"capawesome:build": "NODE_OPTIONS='--max-old-space-size=4096' npm run build"
```

## Build fails during signing

If an iOS or Android build fails while signing, confirm that the [signing certificate](certificates/index.md) is configured correctly and that the provisioning profile matches the bundle ID and selected build type. For multi-target apps, see [Custom iOS provisioning profiles](custom-ios-provisioning-profiles.md).

## Still stuck?

Reach out via [Support](../../support/index.md) with a link to the failed build and its logs.
