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.