# Android build failed

**URL:** <https://forums.unrealengine.com/t/android-build-failed/2063370>\
**Category:** Platform & Builds\
**Tags:** Mobile, gradle, Mobile-Packaging, unreal-engine, question\
**Created:** [October 11, 2024, 12:40pm UTC](https://forums.unrealengine.com/t/android-build-failed/2063370 "2024-10-11T12:40:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lp198](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@lp198](https://forums.unrealengine.com/u/lp198)\
**Post date:** [October 11, 2024, 12:40pm UTC](https://forums.unrealengine.com/t/android-build-failed/2063370/1 "2024-10-11T12:40:50Z")

</div>

Hey,

Running into an issue when packaging for android. Followed the steps from here [How to Set Up Android SDK and NDK For Your Unreal Engine Development Environment | Unreal Engine 5.3 Documentation | Epic Developer Community](https://dev.epicgames.com/documentation/en-us/unreal-engine/how-to-set-up-android-sdk-and-ndk-for-your-unreal-engine-development-environment?application_version=5.3)

but getting this error.

UATHelper: Packaging (Android (ASTC)): \> Could not resolve all files for configuration ‘:classpath’.  
UATHelper: Packaging (Android (ASTC)): \> Could not resolve com.android.tools.build:gradle:7.4.2.  
UATHelper: Packaging (Android (ASTC)): Required by:  
UATHelper: Packaging (Android (ASTC)): project :  
UATHelper: Packaging (Android (ASTC)): \> No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute ‘org.gradle.plugin.api-version’ with value ‘7.5’ but:  
UATHelper: Packaging (Android (ASTC)): - Variant ‘apiElements’ capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:  
UATHelper: Packaging (Android (ASTC)): - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8  
UATHelper: Packaging (Android (ASTC)): - Other compatible attribute:  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about org.gradle.plugin.api-version (required ‘7.5’)  
UATHelper: Packaging (Android (ASTC)): - Variant ‘javadocElements’ capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:  
UATHelper: Packaging (Android (ASTC)): - Incompatible because this component declares documentation and the consumer needed a library  
UATHelper: Packaging (Android (ASTC)): - Other compatible attributes:  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about its target Java version (required compatibility with Java 8)  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about its elements (required them packaged as a jar)  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about org.gradle.plugin.api-version (required ‘7.5’)  
UATHelper: Packaging (Android (ASTC)): - Variant ‘runtimeElements’ capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:  
UATHelper: Packaging (Android (ASTC)): - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8  
UATHelper: Packaging (Android (ASTC)): - Other compatible attribute:  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about org.gradle.plugin.api-version (required ‘7.5’)  
UATHelper: Packaging (Android (ASTC)): - Variant ‘sourcesElements’ capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:  
UATHelper: Packaging (Android (ASTC)): - Incompatible because this component declares documentation and the consumer needed a library  
UATHelper: Packaging (Android (ASTC)): - Other compatible attributes:  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about its target Java version (required compatibility with Java 8)  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about its elements (required them packaged as a jar)  
UATHelper: Packaging (Android (ASTC)): - Doesn’t say anything about org.gradle.plugin.api-version (required ‘7.5’)

---

<div class="post-metadata">

**Author:** ![tootzoe1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tootzoe1](https://forums.unrealengine.com/u/tootzoe1)\
**Post date:** [October 11, 2024, 1:35pm UTC](https://forums.unrealengine.com/t/android-build-failed/2063370/2 "2024-10-11T13:35:36Z")

</div>

i also encounted this error when i tried to package apk last week, the only time i successfully packaged apk is that i built unrealeditor.exe from source code , and than i packaged 3 offical samples (StackOBot, lyra, Cropout) for android successfully.

now i try donwload UE5.5 source code and build apk again…

---

<div class="post-metadata">

**Author:** ![FrostyJas](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frostyjas/32/1194640_2.png) [@FrostyJas](https://forums.unrealengine.com/u/FrostyJas)\
**Post date:** [October 12, 2024, 4:51am UTC](https://forums.unrealengine.com/t/android-build-failed/2063370/3 "2024-10-12T04:51:15Z")

</div>

Based on the error log you’re showing there it looks like you’re running the wrong version of Java.(See line 5 and continue several lines down to see the compatibility responses) Also, make sure your SDK is properly installed/configured.

---

<div class="post-metadata">

**Author:** ![tootzoe1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tootzoe1](https://forums.unrealengine.com/u/tootzoe1)\
**Post date:** [October 12, 2024, 7:23pm UTC](https://forums.unrealengine.com/t/android-build-failed/2063370/4 "2024-10-12T19:23:09Z")

</div>

I built UE5.5 from source code (branch dev-5.5), it seems EPIC have cleanup the whole source code, before i built UE5.4.4 (branch release), it took me more than 2 hours , now less than 2 hours, they split all components about Android from x64 build, android components will only be build when they are needed.  
i can’t package apk successfully by the engine (5.4.4) downloaded by Games Launcher, but i can package apk smoothly after i built engine5.5 from source code, all the stuffs releated to android is the same (android SDK ,NDK , JAVA version , gradle ) as before , i didn’t touch them. the errors above gone…  
the cons that build from source code is it take up my 300G disk space…
