Gradle support in UE 4.17

Starting with the UE 4.17 release Gradle is supported as an experimental build option. This is enabled per project in the Android Project Settings with the “Enable Gradle instead of Ant [Experimental]” checkbox. If you have not previously accepted the Android SDK license agreement, a dialog will be shown with the agreement. Select “Agree” and the proper license file will be created so Gradle can download dependencies.

AAR files registered either with aar-imports.txt or Unreal Plugin Language (UPL) <AARImports/> are automatically added as dependencies for Gradle. Additions to the build.gradle may be made using the UPL <buildGradleAdditions/> node. Another way to add to the build.gradle is with an “additions.gradle” file in any directory normally copied to JavaLibs by a <prebuildCopies/> node (see Engine/Source/ThirdParty/AndroidPermission/permission_library for an example).

One useful benefit of the new Gradle build path is the ability to load the resulting build.gradle after launch or packaging in Android Studio. This file may be found in your project’s Intermediate/Android/APK/gradle directory. While native debugging is not yet available with this implementation, you can hit Run or Debug if you have done a launch or installed the OBB from packaging with the batch file first. You can make changes to the Java code or add breakpoints for debugging Java and iterate if you don’t change content or native code. WARNING: you are working on a COPY of the Java code in this location so make sure you copy any changes to the normal location before using launch or package again from the UE4 Editor or these changes will be overwritten!

Please let us know of any issues encountered with Gradle in this release; we intend to remove Ant support as it is no longer supported by Google.

This is a huuuuge improvement for Android plugin developers! Thank you for doing this :slight_smile:

Gradle! This is definitely a big win for Android devs. Thanks Chris!

this is awesome.
do you have a estimated release date for 4.17?

Tried this out for my project and build times are greatly reduced!

gradle: 1min40
ant: 2min30

much appreciated! :slight_smile:

Getting an error exporting with Gradle for my Daydream build: 4.17 Exporting Daydream project with Gradle results in errors - Programming & Scripting - Unreal Engine Forums
Ant works fine - looks to be an issue with the daydream plugin?

Add this file: Engine/Source/ThirdParty/GoogleVR/lib/common_library/additions.gradle

dependencies {
        compile fileTree(dir: 'libs', include: '*.jar'])

This will let Gradle know about the jar files in the libs directory.

Hi All

I have this problem
what happen to me?

The error message is so misleading, i fixed mine after updating android SDK , SDK platformtools, SDK build tools and installing android support repository with installing API 23 and all that from android SDK manager which is located in default at C:\NVPACK

Hi Chris Babcock

Please don’t take Ant support from UE4 as i spent the past 2 days working on deploying my project on old android 2.3.6 without a success and then i found out when i compile my package with Gradle it will not allow old androids to unpack it even with choosing the same setting of SDK/API level from project setting, but when i package it with normal Ant it works fine, so getting ride of Ant means UE4 is not going to support old androids which is really effective decision.
As FYI here is the setting in my project setting in case any one from your team liked to test it

Android SDK : SDK API = latest , NDK level = android-19
Android : Min SDK & Target SDK = 9

Hello @mhnoni ,

ANT is deprecated and is no longer supported by Google. It will be definitely dropped in the future from UE4. Google also doesn’t support Android 2.3.6 because this is very old system… Are you sure that your game would be run fine on this device? Currently only 0.3% of devices around the world are run on the 2.x.x version… It doesn’t have sense to support these devices… Look on the platform versions statistics:…rds/index.html

Actually after i successfully packaged with ANT i were able to successfully install the test project in my old phone but then when i launched the app it crashed, i tried to find the log but couldn’t seems it crash before making a log, and with my simple knowledge on Logcat i was unable to find the problem, the test done in 4.18, so i guess dropping ANT now is not going to effect anything as new updates of UE4 seems already not supporting 2.3.6 . my last successful packaging for 2.3.6 was in 4.12 (haven’t tested any version of the engine after that so i don’t know which is the latest version of the engine were still supporting API 2.3.6). anyway in case anyone like to make a game for 2.3.6 then they will have to use old version of the engine or upgrade their phone :slight_smile:
BTW i don’t have problem with upgrading my phone which i have to as i would like to get a new phone for testing some ARCore/ARKit stuff but its always cool to make simple game for old phones.

Hi guys, I have a question…

Whats the latest android SDK version that’s supported in Unreal?

I’m trying to build an AR app for my Galaxy S8 that has Android SDK 8.0.0 (oreo) installed, I have that corresponding SDK-26 installed on my pc but the camera doesn’t work properly when i build it.

Android SDK : SDK API = android-26 , NDK level = android-19
Android : Min SDK & Target SDK = 26

The main question is: does it have any sense to make game for 2.3.6 which is only on 0.3% devices? And in the next year will be even lower? 0.1% or 0.05%… Google doesn’t support 2.3.6 so why Epic should do that? :wink: