Uploaded image for project: 'Qt Tools for Android'
  1. Qt Tools for Android
  2. QTTA-188

Gradle build fails with task dependency issues on release builds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • QtGP 1.1
    • QtGP: General
    • 4579c8286 (dev)

    Description

      When building our examples from the command line, Gradle builds both a debug and a release APK. Building the release APK involves some tasks that are not part of the debug build, mainly resource stripping, linting etc.

      Some of these tasks currently fail because Gradle can't figure out whether they depend of QtBuildTask.

      > Task :app:lintVitalAnalyzeRelease FAILED
      
      FAILURE: Build failed with an exception.
      
      * What went wrong:
      A problem was found with the configuration of task ':app:lintVitalAnalyzeRelease' (type 'AndroidLintAnalysisTask').
        - Gradle detected a problem with the following location: '/Users/ollivuolteenaho/Qt/Examples/Qt-6.8.0/platforms/android/qtquickview_java/app/build/qt_generated/qtquickview/android-build-qtquickview/qtquickview.aar'.
      
          Reason: Task ':app:lintVitalAnalyzeRelease' uses this output of task ':app:QtBuildTask' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
      
          Possible solutions:
            1. Declare task ':app:QtBuildTask' as an input of ':app:lintVitalAnalyzeRelease'.
            2. Declare an explicit dependency on ':app:QtBuildTask' from ':app:lintVitalAnalyzeRelease' using Task#dependsOn.
            3. Declare an explicit dependency on ':app:QtBuildTask' from ':app:lintVitalAnalyzeRelease' using Task#mustRunAfter.
      
          For more information, please refer to https://docs.gradle.org/8.10/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.
      > Task :app:collectReleaseDependencies FAILED FAILURE: Build failed with an exception. * What went wrong: A problem was found with the configuration of task ':app:collectReleaseDependencies' (type 'PerModuleReportDependenciesTask'). - Gradle detected a problem with the following location: '/Users/ollivuolteenaho/Qt/Examples/Qt-6.8.0/platforms/android/qtquickview_java/app/build/qt_generated/qtquickview/android-build-qtquickview/qtquickview.aar'.    Reason: Task ':app:collectReleaseDependencies' uses this output of task ':app:QtBuildTask' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.    Possible solutions:      1. Declare task ':app:QtBuildTask' as an input of ':app:collectReleaseDependencies'.      2. Declare an explicit dependency on ':app:QtBuildTask' from ':app:collectReleaseDependencies' using Task#dependsOn.      3. Declare an explicit dependency on ':app:QtBuildTask' from ':app:collectReleaseDependencies' using Task#mustRunAfter.
      

      The fix should be to add these dependencies in QtGP.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTTA-188
          # Subject Branch Project Status CR V

          Activity

            People

              teko Tero Koponen
              olvuolte Olli Vuolteenaho
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes