Android build failed

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

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’)

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…

1 Like

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.

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…

1 Like