Announcement

Collapse
No announcement yet.

Gradle support in UE 4.17

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 06:09 PM.

  • #2
    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

    Comment


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

      Co-Founder - Get Set Games | Twitter | LinkedIn

      Comment


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

        Comment


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

          gradle: 1min40
          ant: 2min30

          much appreciated!
          Headgear - VR solutions

          VR Game Release: We Come In Peace...
          Oculus GearVR: https://www2.oculus.com/experiences/...6630401745678/
          Daydream VR: https://play.google.com/store/apps/details?id=com.headgear.WCIP

          Comment


          • #6
            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/que...e-results.html
            Ant works fine - looks to be an issue with the daydream plugin?
            Headgear - VR solutions

            VR Game Release: We Come In Peace...
            Oculus GearVR: https://www2.oculus.com/experiences/...6630401745678/
            Daydream VR: https://play.google.com/store/apps/details?id=com.headgear.WCIP

            Comment


            • #7
              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.

              Comment


              • #8
                Hi All

                I have this problem
                https://answers.unrealengine.com/que...accept-th.html
                what happen to me?

                Comment

                Working...
                X