Search code examples
androidgradleunreal-engine4

Unreal Engine Gradle errors


I am currently trying to deploy an Unreal Engine 4.27 project to an Android phone. I have followed the official instructions on how to set-up Android deployment and I am running Gradle 7.0.3 and have tried 8+ and 6+.

At first I had errors about my Java install, I have updated this to OpenJDK 21 and those errors stopped. I then had errors with my Android Studio install, after a full reinstall those errors have also stopped, but my main problem now is a new error.

LogPlayLevel: A problem occurred configuring project ':app'.
LogPlayLevel: > Could not create task ':app:processDebugMainManifest'.
LogPlayLevel:    > Cannot use @TaskAction annotation on method IncrementalTask.taskAction$gradle_core() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.

I have tried all solutions online and nothing has helped. I have wiped Gradle off my PC and reinstalled and that didn't help, I have tried deploying a completely empty project and that hasn't helped.

What can I try next?

I tried to deploy an Unreal Engine 4.27 project to an android phone and also package to an Android folder. I was expecting the project to deploy to the phone or deploy to the folder, but both get the same error.


Solution

  • The problem was a mismatch in Gradle versions between the various gradle files in the project. Manually going over every single one ane verifying the Gradle install worked.

    I then had an AAPT2 error, that was fixed by downgrading my APK tools to 32.0.0. Then I had a APK tools corruption error and that was resolved by renaming the d8 scripts to dx in the SDK build files. Then I had Unreal Engine errors on deploying to Android 14, that required a code source change linked here: https://forums.unrealengine.com/t/targeting-s-version-31-and-above-requires-that-an-explicit-value-for-android/781380/2 (2nd comment)

    Then I had issues with ASTC saying there was no descriptor file, that was fixed by using ETC2 instead. Then it was constantly crashing on the splashscreen and that was because android studio doesn't support OpenGL 3.2.

    Finally deployed it to my personal phone after all this faff and it's deployed successfully!