Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-30554

Android qtMinSdkVersion is wrong if I don't delete .pro.user before starting Qt Creator

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • Qt Creator 13.0.0
    • Qt Creator 12.0.2
    • Android Support
    • None
    • Linux/X11
    • 44bf71169 (13.0)

    Description

      This bug didn't happen on 12.0.0 (can't say anything about 12.0.1, I never installed it). [EDIT: going through my git history – yes, I know, pro.user files shouldn't be versioned – I'm not so sure right now about 12.0.0 being bug-free on this matter: I can find just a few references to this version, which I can't vouch for; v11 was definitely NOT buggy though]

       

      With 12.0.2 I started having issues with Android qtMinSdkVersion: packages being compiled with minSdk 31 instead of the usual 23. This happens with both Qt 6.5.2 and 6.5.3.

      I managed to reproduce the problem and find out what happens:

      • close Qt Creator
      • delete pro.user file
      • open Qt Creator
      • reconfigure project (select kits etc)
      • as long as Qt Creator is not closed, everything builds fine (qtMinSdkVersion = 23)
      • close Qt Creator and reopen it
      • now when compiling the problem appears (qtMinSdkVersion = 31)
      • close Qt Creator, delete pro.user file and reopen/reconfigure, everything is fine again (qtMinSdkVersion = 23)

      As far as I can tell, there is a bug either when writing the pro.user file, or when reading it back.

      Note that I staged a newly generated pro.user in git, confirmed it builds correctly, then diff'ed it once Qt Creator is closed: no relevant differences that could explain the abnormal behaviour when Qt Creator is opened again. So we can exclude the scenario where Qt Creator writes something wrong specifically at exit time.

      I'm attaching a pro.user file that triggers the bug if it is present when starting Qt Creator, paths and names anonymized but otherwise untouched, in case there is something wrong in the file itself (which would mean the bug is during writing the file, not reading it back). However the only reference to "31" is "android-31" which is my target sdk and totally expected to be in here.

      From all evidence I collected, it seems that the bug is likely to be in the reading of pro.user files (unless, somehow, the writing "forgets" to write a critical value... but at least it doesn't seem to write wrong values).

      To confirm the issue and avoid incorrect builds I now use the following code in build.gradle:

      gradle.taskGraph.whenReady { graph ->
          if (qtMinSdkVersion.toInteger() > 23) {
              logger.warn('qtMinSdk: {}', qtMinSdkVersion)
              logger.warn('')
              throw new GradleException("======== QT MIN SDK IS ACTING UP AGAIN ========")
              }
      }

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              portale Alessandro Portale
              irual I R
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes