User Tag List

Results 1 to 7 of 7

Thread: Gradle support in UE 4.17

  1. #1
    0
    Unreal Engine Developer
    Join Date
    Jun 2014
    Posts
    840

    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.
    Last edited by Chris Babcock; 07-18-2017 at 06:09 PM.

  2. #2
    0
    Quote Originally Posted by Chris Babcock View Post
    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

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

    Co-Founder - Get Set Games | Twitter | LinkedIn

  4. #4
    0
    Samaritan
    Join Date
    Jan 2016
    Posts
    112
    this is awesome.
    do you have a estimated release date for 4.17?

  5. #5
    0
    Tried this out for my project and build times are greatly reduced!

    gradle: 1min40
    ant: 2min30

    much appreciated!

  6. #6
    0
    Quote Originally Posted by Chris Babcock View Post
    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.
    Getting an error exporting with Gradle for my Daydream build: https://answers.unrealengine.com/questions/678203/417-exporting-daydream-project-with-gradle-results.html
    Ant works fine - looks to be an issue with the daydream plugin?

  7. #7
    0
    Unreal Engine Developer
    Join Date
    Jun 2014
    Posts
    840
    Add this file: Engine/Source/ThirdParty/GoogleVR/lib/common_library/additions.gradle

    Code:
    dependencies {
            compile fileTree(dir: 'libs', include: ['*.jar'])
    }
    This will let Gradle know about the jar files in the libs directory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •