Download

[HELP] Android\arm64\gradle\rungradle.bat ERROR HELL

Hi. I have done so many research and google. But can’t solve this error yet.

I’m using 4.26 engine now. And my setting steps for Android packaging like below:

Install Android Studio - Latest Version
Install Java 8
Run Setup Android

SDKConfig :

Android SDK - C:/Users/xxx/AppData/Local/Android/Sdk
Android NDK - C:/Users/xxx/AppData/Local/Android/Sdk/ndk/21.4.7075529
JAVA - C:/Program Files/Java/jdk1.8.0_301
SDK API Level - latest
NDK API Level - latest

What I was packaging (Project Settings) is like below :

Package game data inside .apk - Enabled
Allow large OBB files - Enabled
Support arm64 - Enabled
Support OpenGL ES3.1 - Enabled
Support Vulkan - Enabled

What I have tried to solve it :

Delete Intermediate folder - Not working
Delete Only Intermediate/Android folder - Not working
Delete android-sdk-license - Not working
Run C://NVPACK something - No such things in 4.26 version up to.

Any other advice or helps ?

1 Like

I don’t yet have any advice, but I am very recently encountering gradle issues myself. I was fine with packaging until I reinstalled Andriod Studio recently, and now I am getting gradle issues that usually I had been able to resolve by deleting Intermediate, as you did.

The errors I am getting are bolded below:

UATHelper: Packaging (Android (ASTC)): ====7/22/2021 8:45:04 PM====PERFORMING FINAL APK PACKAGE OPERATION=====-armv7===========================================
UATHelper: Packaging (Android (ASTC)): Copying C:\Users\rober\Documents\Unreal Projects\TutorialProject\Intermediate\Android\armv7\AndroidManifest.xml to C:\Users\rober\Documents\Unreal Projects\TutorialProject\Intermediate\Android\armv7\gradle\app\src\main\AndroidManifest.xml
UATHelper: Packaging (Android (ASTC)): Fixing minSdkVersion; NDK level above 19 requires minSdkVersion of 21 (arch=armv7)
UATHelper: Packaging (Android (ASTC)): Creating rungradle.bat to work around commandline length limit (using unused drive letter X:)
UATHelper: Packaging (Android (ASTC)): Making .apk with Gradle…
UATHelper: Packaging (Android (ASTC)): To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: The Gradle Daemon.
UATHelper: Packaging (Android (ASTC)): Daemon will be stopped at the end of the build stopping after processing
UATHelper: Packaging (Android (ASTC)): Build-tool 31.0.0 is missing DX at C:\Users\rober\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat
UATHelper: Packaging (Android (ASTC)): File C:\Users\rober.android\repositories.cfg could not be loaded.
UATHelper: Packaging (Android (ASTC)): Build-tool 31.0.0 is missing DX at C:\Users\rober\AppData\Local\Android\Sdk\build-tools\31.0.0\dx.bat
UATHelper: Packaging (Android (ASTC)): FAILURE: Build failed with an exception.
UATHelper: Packaging (Android (ASTC)): * What went wrong:
UATHelper: Packaging (Android (ASTC)): Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.
UATHelper: Packaging (Android (ASTC)): > Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.
UATHelper: Packaging (Android (ASTC)): * Try:
UATHelper: Packaging (Android (ASTC)): Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
UATHelper: Packaging (Android (ASTC)): * Get more help at https://help.gradle.org
UATHelper: Packaging (Android (ASTC)): BUILD FAILED in 10s
UATHelper: Packaging (Android (ASTC)): ERROR: cmd.exe failed with args /c “C:\Users\rober\Documents\Unreal Projects\TutorialProject\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleDebug
UATHelper: Packaging (Android (ASTC)): (see C:\Users\rober\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\Log.txt for full exception trace)
PackagingResults: Error: cmd.exe failed with args /c “C:\Users\rober\Documents\Unreal Projects\TutorialProject\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleDebug
UATHelper: Packaging (Android (ASTC)): AutomationTool exiting with ExitCode=1 (Error_Unknown)
UATHelper: Packaging (Android (ASTC)): BUILD FAILED
PackagingResults: Error: Unknown Error

I have just done this little video, though it didn’t help.

But I will ask, are you also seeing the " ERROR “Installed Build Tools revision 31.0.0 is corrupted” in Android Studio" issue?

I will continue with this tomorrow…

1 Like

Ok, if you’re getting the “Installed Build Tools revision 31.0.0 is corrupted.” error, a simple fix is to:

  • go into Android Studio’s SDK Manager
  • go to SDK Tools
  • Select “Show package Details”
  • Unselect 31.0.0
  • Reboot

I’m now able to package APK’s again, without gradle errors.

1 Like

This is perfect solution. Thanks

1 Like


Getting same gradle error but haven’t Insatlled 31.0+ sdk anytime for shipping release version. Build working good for development version

{this is the full error.}

Running AutomationTool…
Parsing command line: -ScriptsForProject=“C:/Users/adila/OneDrive/Documents/Unreal Projects/finished/finished.uproject” BuildCookRun -project=“C:/Users/adila/OneDrive/Documents/Unreal Projects/finished/finished.uproject” -noP4 -clientconfig=Development -serverconfig=Development -nocompile -nocompileeditor -installed -ue4exe=“C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\Win64\UE4Editor-Cmd.exe” -utf8output -platform=Android -targetplatform=Android -cookflavor=ASTC -ini:Game:[/Script/UnrealEd.ProjectPackagingSettings]:BlueprintNativizationMethod=Disabled -build -cookonthefly -nokill -map= -compressed -stage -deploy -cmdline=" -Messaging" -device=Android_ASTC@572c4ea7 -addcmdline="-SessionId=9A5F2DA14DC8ECBBCEF1F5B2BBB47578 -SessionOwner=‘adila’ -SessionName=‘POCO_F1 (572c4ea7)’ " -run
Setting up ProjectParams for C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\finished.uproject
finished.uproject requires a temporary target.cs to be generated (PythonScriptPlugin plugin is enabled)
********** BUILD COMMAND STARTED **********
Running: C:\Program Files\Epic Games\UE_4.26\Engine\Binaries\DotNET\UnrealBuildTool.exe finished Android Development -Project=“C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\finished.uproject” “C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\finished.uproject” -NoUBTMakefiles -remoteini=“C:\Users\adila\OneDrive\Documents\Unreal Projects\finished” -skipdeploy -ini:Game:[/Script/UnrealEd.ProjectPackagingSettings]:BlueprintNativizationMethod=Disabled -Manifest=“C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Intermediate\Build\Manifest.xml” -NoHotReload -log=“C:\Users\adila\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\UBT-finished-Android-Development.txt”
PLATFORM_ANDROID_NDK_VERSION = 210500
NDK toolchain: r21e, NDK version: 21, GccVersion: 4.9, ClangVersion: 9.0.9
Compiling Native 32-bit code with NDK API ‘android-21’
Writing manifest to C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Intermediate\Build\Manifest.xml
Target is up to date
Deploying finished Android Development…
AndroidPlugin: Plugins\Online\Android\OnlineSubsystemGooglePlay\Source\OnlineSubsystemGooglePlay_UPL.xml
AndroidPlugin: Plugins\Runtime\AndroidPermission\Source\AndroidPermission\AndroidPermission_APL.xml
AndroidPlugin: Plugins\Runtime\GoogleCloudMessaging\Source\GoogleCloudMessaging\GoogleCloudMessaging_UPL.xml
AndroidPlugin: Plugins\Runtime\GooglePAD\Source\GooglePAD\GooglePAD_APL.xml
AndroidPlugin: Plugins\Runtime\Oculus\OculusVR\Source\OculusHMD\OculusMobile_APL.xml
AndroidPlugin: Source\Runtime\Online\Voice\AndroidVoiceImpl_UPL.xml
AndroidPlugin: Source\ThirdParty\GoogleGameSDK\GoogleGameSDK_APL.xml
UPL: …\Plugins/Online/Android/OnlineSubsystemGooglePlay/Source/OnlineSubsystemGooglePlay_UPL.xml
UPL: …\Plugins/Runtime/AndroidPermission/Source/AndroidPermission/AndroidPermission_APL.xml
UPL: …\Plugins/Runtime/GoogleCloudMessaging/Source/GoogleCloudMessaging/GoogleCloudMessaging_UPL.xml
UPL: …\Plugins/Runtime/GooglePAD/Source/GooglePAD/GooglePAD_APL.xml
UPL: …\Plugins/Runtime/Oculus/OculusVR/Source/OculusHMD/OculusMobile_APL.xml
UPL: …\Source/Runtime/Online/Voice/AndroidVoiceImpl_UPL.xml
UPL: …\Source/ThirdParty/GoogleGameSDK/GoogleGameSDK_APL.xml
Using package name: ‘com.YourCompany.finished’
GotStoreVersion found v1. (bUseChangeListAsStoreVersion=False IsBuildMachine=False EngineChangeList=0)
Writing packageInfo pkgName:com.YourCompany.finished storeVersion:1 versionDisplayName:1.0 to C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Binaries\Android\packageInfo.txt

====7/28/2021 1:38:04 PM====PREPARING TO MAKE APK=================================================================
bBuildForES31: true
bSupportsVulkan: false
Building Java with SDK API level ‘android-31’
Building with Build Tools version ‘31.0.0’

==== Writing to shim file C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Build\Android\src\com\epicgames\ue4\DownloadShim.java ====

==== Shim data file up to date so not writing. ====

==== Writing to template target file C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Build\Android\src\com\YourCompany\finished\AlarmReceiver.java ====

==== Template target file up to date so not writing. ====

==== Writing to template target file C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Build\Android\src\com\YourCompany\finished\DownloaderActivity.java ====

==== Template target file up to date so not writing. ====

==== Writing to template target file C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Build\Android\src\com\YourCompany\finished\OBBDownloaderService.java ====

==== Template target file up to date so not writing. ====
Cleaning up files based on template dir C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Build\Android\src\com\YourCompany\finished
C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Binaries\Android\finished-armv7.apk is out of date due to newer input file C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Binaries\Android\finished-armv7.so
UPL Init: armeabi-v7a
Subsystem Google Play SDK Android init
Android Permission Plugin Init
Google Cloud Messaging init
GCMClientSenderID set: false
GooglePAD Plugin Init
GooglePAD enabled: false
Oculus mobile init
Oculus Signature Files (osig) will be removed from APK
Android Voice init
GoogleGameSDK Android init
On build machine.
Fixing minSdkVersion; NDK level above 19 requires minSdkVersion of 21 (arch=armv7)
Fixing minSdkVersion; NDK level above 19 requires minSdkVersion of 21 (arch=armv7)

====7/28/2021 1:38:05 PM====PREPARING NATIVE CODE=====-armv7============================================================
bPackageDataInsideApk = True
Obb location C:\Users\adila\OneDrive\Documents\Unreal Projects\finished/Saved/StagedBuilds/Android.obb
Obb destination location C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Intermediate\Android\armv7/assets
Added repository: …\Source\ThirdParty\Android\extras\google\m2repository
Added repository: …\Source\ThirdParty\Android\extras\android\m2repository
AARImports: com.google.android.gms, play-services-auth, 11.8.0
AARImports: com.google.android.gms, play-services-games, 11.8.0
AARImports: com.google.android.gms, play-services-nearby, 11.8.0
AARImports: com.google.android.gms, play-services-plus, 11.8.0
Copying Google Play BillingApiV2 java files

Directory …/Plugins/Online/Android/OnlineSubsystemGooglePlay/Source/Java/BillingApiV2 copied to C:/Users/adila/OneDrive/Documents/Unreal Projects/finished/Intermediate/Android/armv7/src
Copying permission_library directory to staging before build

Directory …//Source/ThirdParty/AndroidPermission/permission_library copied to C:/Users/adila/OneDrive/Documents/Unreal Projects/finished/Intermediate/Android/armv7/JavaLibs/permission_library

==== Writing to OBB data file C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Intermediate\Android\armv7\src\com\YourCompany\finished\OBBData.java ====

==== OBB data file up to date so not writing. ====
Copying libplaycore.so and proguard files

File C:/Program Files/Epic Games/UE_4.26/Engine/Plugins/Runtime/GooglePAD/Source/GooglePAD/…/ThirdParty/play-core-native-sdk/libs/armeabi-v7a/ndk21.4.7075529/c++_shared/libplaycore.so copied to C:/Users/adila/OneDrive/Documents/Unreal Projects/finished/Intermediate/Android/armv7/libs/armeabi-v7a/libplaycore.so
Copying libvrapi.so

File …//Source/ThirdParty/Oculus/OVRPlugin/OVRPlugin/ExtLibs/armeabi-v7a/libvrapi.so copied to C:/Users/adila/OneDrive/Documents/Unreal Projects/finished/Intermediate/Android/armv7/libs/armeabi-v7a/libvrapi.so
Copying libOVRPlugin.so

File …//Source/ThirdParty/Oculus/OVRPlugin/OVRPlugin/Lib/armeabi-v7a/libOVRPlugin.so copied to C:/Users/adila/OneDrive/Documents/Unreal Projects/finished/Intermediate/Android/armv7/libs/armeabi-v7a/libOVRPlugin.so

File …//Source/ThirdParty/Oculus/OVRPlugin/OVRPlugin/ExtLibs/VrApi.jar does not exist, not copied!

File …//Source/ThirdParty/Oculus/OVRPlugin/OVRPlugin/ExtLibs/SystemUtils.jar does not exist, not copied!

====7/28/2021 1:38:07 PM====PERFORMING FINAL APK PACKAGE OPERATION=====-armv7===========================================
Fixing minSdkVersion; NDK level above 19 requires minSdkVersion of 21 (arch=armv7)

Creating rungradle.bat to work around commandline length limit (using unused drive letter Z:)
Making .apk with Gradle…
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: The Gradle Daemon.
Daemon will be stopped at the end of the build stopping after processing
Build-tool 31.0.0 is missing DX at C:\AndroidSdkLocation\build-tools\31.0.0\dx.bat
File C:\Users\adila.android\repositories.cfg could not be loaded.
Build-tool 31.0.0 is missing DX at C:\AndroidSdkLocation\build-tools\31.0.0\dx.bat

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.

Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 55s
ERROR: cmd.exe failed with args /c “C:\Users\adila\OneDrive\Documents\Unreal Projects\finished\Intermediate\Android\armv7\gradle\rungradle.bat” :app:assembleDebug
Took 139.7422175s to run UnrealBuildTool.exe, ExitCode=6
UnrealBuildTool failed. See log for more details. (C:\Users\adila\AppData\Roaming\Unreal Engine\AutomationTool\Logs\C+Program+Files+Epic+Games+UE_4.26\UBT-finished-Android-Development.txt)
AutomationTool exiting with ExitCode=6 (6)
BUILD FAILED

Build-tool 31.0.0 is missing DX at C:\AndroidSdkLocation\build-tools\31.0.0\dx.bat

can anybody help me plz