Android build: At war with SDK, NDK, Java and Gradle

My computer crashed and i had to reinstall windows. I have everything set back up (my project was fine - saved on an external drive). getting set back up, i had to go to day 1 stuff. i installed UE 5.2.1 (i have to be on this version), java, android studio, visual studio, command-line tools 8.0, etc

My first battle was getting the right SDK, NDK, Java version. I think i got it right. i set advanced system variables and set everything up in my packaging like this:

I am targeting SDK 34 because i am supposed to for play console. I installed java 17 because that’s what UE documentation says to do. My problem is gradle. I cannot figure out what wrapper and gradle version to define in order to get this to build. I have been through hundreds of articles. Most seem to indicate that for java SE 17, you should use gradle 7.3

I’ve tried every gradle version known to man. I’ve also tried different java versions and repeated different gradle versions. I am just chasing my tail at this point. The errors when building differ depending on what gradle version I’m attempting to use. but the two that seems to stand out the most are:

and this:

Task :app:compileReleaseRenderscript NO-SOURCE
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :app:generateReleaseResValues
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :app:generateReleaseResources
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :downloader_library:compileReleaseRenderscript NO-SOURCE
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :downloader_library:generateReleaseResValues
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :downloader_library:generateReleaseResources
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :downloader_library:packageReleaseResources
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :permission_library:compileReleaseRenderscript NO-SOURCE
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :permission_library:generateReleaseResValues
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :permission_library:generateReleaseResources
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :permission_library:packageReleaseResources
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :app:createReleaseCompatibleScreenManifests
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :app:extractDeepLinksRelease
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :downloader_library:extractDeepLinksRelease
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :permission_library:extractDeepLinksRelease
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :permission_library:processReleaseManifest FAILED
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :app:processReleaseAssetPackManifests
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :downloader_library:processReleaseManifest
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Task :app:mergeReleaseResources
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * What went wrong:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Execution failed for task ‘:permission_library:processReleaseManifest’.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Error while evaluating property ‘packageOverride’ of task ‘:permission_library:processReleaseManifest’
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Failed to calculate the value of task ‘:permission_library:processReleaseManifest’ property ‘packageOverride’.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Failed to query the value of property ‘applicationId’.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Manifest file does not exist: Z:\permission_library\src\main\AndroidManifest.xml
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Try:
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Run with --stacktrace option to get the stack trace.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Run with --info or --debug option to get more log output.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): > Run with --scan to get full insights.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): See Command-Line Interface
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED in 16s
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): 15 actionable tasks: 15 executed
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): ERROR: cmd.exe failed with args /c “F:\Unreal Projects\MazeGame 5.2\Intermediate\Android\gradle\rungradle.bat” :app:bundleRelease
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): (see C:\Users\roman\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_5.2\Log.txt for full exception trace)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool executed for 0h 4m 4s
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD FAILED
PackagingResults: Error: Unknown Error

Starting to be at wits end with this. some other things i tried that i found in tutorials was editing the android manifest, playing around with setupandroid.bat, and changing changing the names od the “d8” batch files to “dx” inside build tools.

If there is anyone out there with some knowledge of how this should be configured, i will scream your name from the mountain tops so that all the world can know of your glory!

Just an FYI, here is how things are setup in Android Studio:


Here are the pertinent environmental variables:

The answer was java 11, gradle version 6.1.1. Android studio 3.5