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
    Realtime Database Firebase | Ultimate Mobile Kit Firebase | Extended Facebook | Universal Mobile Ads | Google Analytics

    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/AR solutions

          VR Game Release: We Come In Peace... Oculus GearVR | Google Play Daydream

          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/AR solutions

            VR Game Release: We Come In Peace... Oculus GearVR | Google Play Daydream

            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


                  #9
                  Originally posted by kobeSky View Post
                  Hi All

                  I have this problem
                  https://answers.unrealengine.com/que...accept-th.html
                  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

                  Comment


                    #10
                    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

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

                    Comment


                      #11
                      Originally posted by mhnoni View Post
                      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

                      4.18.3
                      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: https://developer.android.com/about/...rds/index.html
                      Realtime Database Firebase | Ultimate Mobile Kit Firebase | Extended Facebook | Universal Mobile Ads | Google Analytics

                      Comment


                        #12
                        Originally posted by gameDNA studio View Post


                        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: https://developer.android.com/about/...rds/index.html
                        HI
                        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
                        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.

                        Comment


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

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

                          Comment


                            #14
                            Originally posted by mhnoni View Post

                            HI
                            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
                            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.
                            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?
                            Realtime Database Firebase | Ultimate Mobile Kit Firebase | Extended Facebook | Universal Mobile Ads | Google Analytics

                            Comment

                            Working...
                            X