Home › Build error fixes › Android / Gradle

Native (C++) build failed

Android / Gradle · last reviewed 2026-11-10

The error looks like this

Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'.

Why it happens

CMake/ninja failed while compiling native code: an NDK version the library does not support, a stale native cache, or on Windows a path that is too long.

How to fix it

  1. Delete the caches: rm -rf android/app/.cxx android/.gradle android/app/build
  2. Use the ndkVersion your React Native version expects (see android/build.gradle).
  3. Windows: move the project to a short path such as C:\dev\app, or enable long paths.
  4. The first "error:" line above shows which library failed.

Not sure this is your error? Let ReleaseMedic read the whole log

Build logs are long and the last line is rarely the real cause. ReleaseMedic finds the first real error, explains it and gives the steps — free, and the log never leaves your computer.

$ npx releasemedic log build.log

Or pipe a build straight in: cd android && ./gradlew bundleRelease 2>&1 | npx releasemedic log -

Catch it before you build

Most release errors come from project settings you can check in seconds — signing, SDK levels, privacy manifests, permissions, push and login setup.

$ npx releasemedic

Related Android / Gradle errors