Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt5.10 & Android Build: Gradle version 2.2 is required. Current version is 3.4.
QtWS25 Last Chance

Qt5.10 & Android Build: Gradle version 2.2 is required. Current version is 3.4.

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 3 Posters 10.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Rayman_
    wrote on last edited by
    #1

    In earlier Qt versions my Android build has been working correctly. After update to Qt 5.10 (Windows 10, NDK 16, SDK 24) I get the following build error:

    FAILURE: Build failed with an exception.
    
    * Where:
    Build file 'D:\Dev\QtBuilds\build-xxxApp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_0_for_Android_armv7-Release\android-build\build.gradle' line: 17
    
    * What went wrong:
    A problem occurred evaluating root project 'android-build'.
    > Failed to apply plugin [id 'com.android.application']
       > Gradle version 2.2 is required. Current version is 3.4. If using the gradle wrapper, try editing the distributionUrl in D:\Dev\QtBuilds\build-xxxApp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_0_for_Android_armv7-Release\android-build\gradle\wrapper\gradle-wrapper.properties to gradle-2.2-all.zip
    

    I did a google search and tried some of the suggestions with modifing the gradle build/properties/distributionUrl files - but no success :-( Has anyone a suggestion here please?

    K 1 Reply Last reply
    0
    • _ _Rayman_

      In earlier Qt versions my Android build has been working correctly. After update to Qt 5.10 (Windows 10, NDK 16, SDK 24) I get the following build error:

      FAILURE: Build failed with an exception.
      
      * Where:
      Build file 'D:\Dev\QtBuilds\build-xxxApp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_0_for_Android_armv7-Release\android-build\build.gradle' line: 17
      
      * What went wrong:
      A problem occurred evaluating root project 'android-build'.
      > Failed to apply plugin [id 'com.android.application']
         > Gradle version 2.2 is required. Current version is 3.4. If using the gradle wrapper, try editing the distributionUrl in D:\Dev\QtBuilds\build-xxxApp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_0_for_Android_armv7-Release\android-build\gradle\wrapper\gradle-wrapper.properties to gradle-2.2-all.zip
      

      I did a google search and tried some of the suggestions with modifing the gradle build/properties/distributionUrl files - but no success :-( Has anyone a suggestion here please?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @_Rayman_ said in Qt5.10 & Android Build: Gradle version 2.2 is required. Current version is 3.4.:

      Failed to apply plugin [id 'com.android.application']
      Gradle version 2.2 is required. Current version is 3.4. If using the gradle wrapper, try editing the distributionUrl in D:\Dev\QtBuilds\build-xxxApp-Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_0_for_Android_armv7-Release\android-build\gradle\wrapper\gradle-wrapper.properties to gradle-2.2-all.zip

      The line is in my gradle-wrapper.properties as follows

      distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip
      

      You have the complete path in the quoted part of your post. Respectively you should also a gradle-wrapper.properties in with your source and not only in your build folder. Change it there.

      The above line works with Qt 5.9 and I would assume that you upgraded from an older version.

      Hope that helps.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • _ Offline
        _ Offline
        _Rayman_
        wrote on last edited by _Rayman_
        #3

        I have the same line in the gradle-wrapper.properties refering to gradle-3.4-bin.zip as you, located in the project build folder as well as in the Qt folder: Qt\5.10.0\android_armv7\src\3rdparty\gradle\gradle\wrapper

        I also did a Clean Build as well as deleting the entire build folder. Before I used Qt 5.9 without problems.

        If I change gradle-3.4-bin.zip to 2.2 as the error message recommends, the version 2.2 gets downloaded during build, followed by a large number of other errors ..

        K 1 Reply Last reply
        0
        • _ _Rayman_

          I have the same line in the gradle-wrapper.properties refering to gradle-3.4-bin.zip as you, located in the project build folder as well as in the Qt folder: Qt\5.10.0\android_armv7\src\3rdparty\gradle\gradle\wrapper

          I also did a Clean Build as well as deleting the entire build folder. Before I used Qt 5.9 without problems.

          If I change gradle-3.4-bin.zip to 2.2 as the error message recommends, the version 2.2 gets downloaded during build, followed by a large number of other errors ..

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @_Rayman_

          Did you check in creator under "Tools"->"Options"->"Devices", Tab "Android" that Andorid settings are ok?

          I have noted in my project SDK 26.0.2 and NDK 10.4.0 are set.

          You are listing SDK 24 and NDK 16.
          To step back in version numbers is not logical and also NDK version is a major step forward. In my trial I found that newest NDK was not correct.

          There might the problem, but I do not know.

          Vote the answer(s) that helped you to solve your issue(s)

          _ 1 Reply Last reply
          0
          • K koahnig

            @_Rayman_

            Did you check in creator under "Tools"->"Options"->"Devices", Tab "Android" that Andorid settings are ok?

            I have noted in my project SDK 26.0.2 and NDK 10.4.0 are set.

            You are listing SDK 24 and NDK 16.
            To step back in version numbers is not logical and also NDK version is a major step forward. In my trial I found that newest NDK was not correct.

            There might the problem, but I do not know.

            _ Offline
            _ Offline
            _Rayman_
            wrote on last edited by
            #5

            @koahnig said in Qt5.10 & Android Build: Gradle version 2.2 is required. Current version is 3.4.:

            @_Rayman_

            Did you check in creator under "Tools"->"Options"->"Devices", Tab "Android" that Andorid settings are ok?

            Yes, all the settings are OK! I used NDK 13 before when the gradle error occured. So I did an update, but that didn't change anything.

            M K 2 Replies Last reply
            0
            • _ _Rayman_

              @koahnig said in Qt5.10 & Android Build: Gradle version 2.2 is required. Current version is 3.4.:

              @_Rayman_

              Did you check in creator under "Tools"->"Options"->"Devices", Tab "Android" that Andorid settings are ok?

              Yes, all the settings are OK! I used NDK 13 before when the gradle error occured. So I did an update, but that didn't change anything.

              M Offline
              M Offline
              mvuori
              wrote on last edited by
              #6

              @_Rayman_ You should downgrade the NDK. All people who have build problems use NDK version higher than the recommended 10e.

              1 Reply Last reply
              1
              • _ _Rayman_

                @koahnig said in Qt5.10 & Android Build: Gradle version 2.2 is required. Current version is 3.4.:

                @_Rayman_

                Did you check in creator under "Tools"->"Options"->"Devices", Tab "Android" that Andorid settings are ok?

                Yes, all the settings are OK! I used NDK 13 before when the gradle error occured. So I did an update, but that didn't change anything.

                K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                @_Rayman_

                To add to @mvuori see also http://doc.qt.io/qt-5/androidgs.html

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • _ Offline
                  _ Offline
                  _Rayman_
                  wrote on last edited by _Rayman_
                  #8

                  Thanks all so far! I downgraded NDK to 10e, deleted the build directories, removed the .gradle-folder in my user-directory, removed the project and its .pro.user file and imported the project again from scratch into Qt Creator 4.5.

                  Upon Android build Gradle 3.4 has been automatically downloaded and the same error remains.

                  Then I removed my QtCreator configuration folder so that all Qt settings got reseted and all Kits newly detected and configured.

                  The same error remains :-(

                  Edit: I changed my gradle-wrapper.properties files to distributionUrl Version 2.9 as suggested by this article and this works! I can successfully compile and deploy to Android systems (phone or emulator):

                  https://discuss.gradle.org/t/gradle-thinks-2-10-is-less-than-2-2-when-resolving-plugins/13434

                  From my point of view this is a gradle specific problem - and I wonder if I am are the only one using Qt 5.10 experiencing this behavior?!

                  K 1 Reply Last reply
                  0
                  • _ _Rayman_

                    Thanks all so far! I downgraded NDK to 10e, deleted the build directories, removed the .gradle-folder in my user-directory, removed the project and its .pro.user file and imported the project again from scratch into Qt Creator 4.5.

                    Upon Android build Gradle 3.4 has been automatically downloaded and the same error remains.

                    Then I removed my QtCreator configuration folder so that all Qt settings got reseted and all Kits newly detected and configured.

                    The same error remains :-(

                    Edit: I changed my gradle-wrapper.properties files to distributionUrl Version 2.9 as suggested by this article and this works! I can successfully compile and deploy to Android systems (phone or emulator):

                    https://discuss.gradle.org/t/gradle-thinks-2-10-is-less-than-2-2-when-resolving-plugins/13434

                    From my point of view this is a gradle specific problem - and I wonder if I am are the only one using Qt 5.10 experiencing this behavior?!

                    K Offline
                    K Offline
                    koahnig
                    wrote on last edited by
                    #9

                    @_Rayman_

                    A bit strange that it works with a down-graded gradle.

                    However, I suggest that you raise the issue also on https://groups.google.com/forum/#!forum/android-qt
                    There is also BogDan who drove the support of android with Qt. Possibly there are more others too seeing similar issues.

                    Vote the answer(s) that helped you to solve your issue(s)

                    1 Reply Last reply
                    0
                    • _ Offline
                      _ Offline
                      _Rayman_
                      wrote on last edited by
                      #10

                      Thank you! I will report this issue to the proposed google list!

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved