Android packaging in Unreal Engine: Execution failed for task

The cook may have succeeded, but the Android build step failed: Gradle stopped on task :app:.... This usually means the Android toolchain does not match what the engine version expects.

  • Blocking: the package fails
  • From user reports, not yet reproduced in our lab

Paste your log: find the cause in seconds Runs in your browser, nothing is uploaded.

Common causes

  • Android SDK, NDK, build-tools or JDK versions that do not match the engine version.
  • Several JDKs installed and the wrong one picked up by JAVA_HOME.
  • A plugin adding incompatible Android libraries.

How to fix it

  1. Read the Gradle output right after this line: the "What went wrong" section names the real problem.
  2. Check your engine version's Android setup page for the expected NDK, SDK platform, build-tools and JDK versions.
  3. Run SetupAndroid.bat from Engine/Extras/Android, then set the SDK, NDK and JDK paths in Project Settings > Platforms > Android SDK.
  4. Delete the project's Intermediate/Android folder and package again.

Questions

Can it be caught before cooking?

Yes, it can be checked before you start a cook: Compare installed SDK, NDK and JDK versions with the engine's support matrix.

Reports and sources

Decode your log

Paste your packaging log, or drop Log.txt with Cook-*.txt / UBA-*.txt. The analysis runs in your browser: the log is never uploaded.

Get notified when the in-editor plugin launches

The same decoder inside the Unreal Editor, with checks that catch these errors before you cook.