this was answered by @user16475264 on Android Studio error "Installed Build Tools revision 31.0.0 is corrupted" - Stack Overflow
basically v31 has changed the name of dx.jar so either :
“-
mklink %ANDROID_HOME%\build-tools\31.0.0\dx.bat %ANDROID_HOME%\build-tools\31.0.0\d8.bat && mklink %ANDROID_HOME%\build-tools\31.0.0\lib\dx.jar %ANDROID_HOME%\build-tools\31.0.0\lib\d8.jar”
or rename d8.bat to dx.bat and d8.jar to dx.jar and v31 will work
until google / epic fix this issue…
also had to install the latest command line tools from android studio,
and edit:
line 81 and 85? of /Engine/Extras/Android/SeupAndroid.bat
@rem set SDKMANAGER=%STUDIO_SDK_PATH%\tools\bin\sdkmanager.bat
set SDKMANAGER=%STUDIO_SDK_PATH%\cmdline-tools\latest\bin\sdkmanager.bat
@anonymous_user_0606cc32 63-ish in 4.27
and run-> cmd: sdkmanager.bat --licenses
to accept all
Using UE5 early access 2
w/ Android studio v. 2020.3.0
jdk 1.8.0_301
gradle:
(unreal install directory)
“\Epic Games\UE_5.0EA\Engine\Build\Android\Java\gradle\gradle\wrapper\gradle-wrapper.properties” :file:
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
and in gradle.build :file:
dependencies {
classpath ‘com.android.tools.build:gradle:4.2.2’
}
using:
Android SDK: C:/Users/[username…]/AppData/Local/Android/Sdk/
Android NDK: C:/Users/[username…]/AppData/Local/Android/Sdk/ndk/21.0.6113669
(installed with ."\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\sdkmanager ndk;21.0.6113669" once installed from AndroidStudio.
JDK: E:/SdkInstallers/Java/jdk1.8.0_301 (path for jdk 8 install/JAVA_HOME )
SDK target version: android-17
NDK target version: android-21
min SDK : 17
max SDK : 31
able to build fine… but only for 64bit in EA5?
not sure if armeabi-v7a is no longer supported in EA5 and I don’t have any 64bit android devices to test on atm.
will try setting up UE4.27 next… still an Unreal n00b… but hope this may help someone
…also works in 4.27 just tested only difference was to this:
Android SDK: C:/Users/[username…]/AppData/Local/Android/Sdk ( must not have the end slash )
********** PACKAGE COMMAND COMPLETED **********
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): ********** ARCHIVE COMMAND STARTED **********
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): Archiving to E:/Unreal Projects/Deploy
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: com.YourCompany.UE4
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: 1
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: com.YourCompany.UE4
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: 1
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: com.YourCompany.UE4
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: 1
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: com.YourCompany.UE4
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): GetPackageInfo ReturnValue: 1
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): ********** ARCHIVE COMMAND COMPLETED **********
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): BUILD SUCCESSFUL
UATHelper: Packaging (Android (Multi:ASTC,DXT,ETC2)): AutomationTool exiting with ExitCode=0 (Success)
Cheers!